10 #define HPM_LCDC_DRV_H
12 #include "hpm_soc_feature.h"
13 #include "hpm_lcdc_regs.h"
23 #define LCDC_TEST_MODE_DISABLE (0U)
24 #define LCDC_TEST_MODE_BACKGROUND (1U)
25 #define LCDC_TEST_MODE_COLOR_BAR_COL (2U)
26 #define LCDC_TEST_MODE_COLOR_BAR_ROW (3U)
132 ptr->
INT_EN |= interrupt_mask;
144 ptr->
INT_EN &= ~interrupt_mask;
194 return ((ptr->
DMA_ST & mask) == mask);
232 return (ptr->
ST & mask) == mask;
274 uint8_t layer_index, uint16_t x, uint32_t y)
291 uint8_t layer_index, uint8_t width, uint8_t height)
310 uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
#define LCDC_LAYER_START0_ADDR0_SET(x)
Definition: hpm_lcdc_regs.h:638
#define LCDC_CTRL_DISP_MODE_MASK
Definition: hpm_lcdc_regs.h:99
#define LCDC_LAYER_LAYPOS_Y_SET(x)
Definition: hpm_lcdc_regs.h:617
#define LCDC_BGND_CL_R_SET(x)
Definition: hpm_lcdc_regs.h:192
#define LCDC_BGND_CL_G_SET(x)
Definition: hpm_lcdc_regs.h:202
#define LCDC_LAYER_LAYPOS_X_SET(x)
Definition: hpm_lcdc_regs.h:627
#define LCDC_LAYER_LAYSIZE_HEIGHT_SET(x)
Definition: hpm_lcdc_regs.h:595
#define LCDC_CTRL_DISP_MODE_SET(x)
Definition: hpm_lcdc_regs.h:101
#define LCDC_LAYER_BG_CL_ARGB_SET(x)
Definition: hpm_lcdc_regs.h:686
#define LCDC_CTRL_BGDCL4CLR_MASK
Definition: hpm_lcdc_regs.h:109
#define LCDC_LAYER_LAYCTRL_EN_MASK
Definition: hpm_lcdc_regs.h:561
#define LCDC_LAYER_LAYCTRL_SHADOW_LOAD_EN_MASK
Definition: hpm_lcdc_regs.h:461
#define LCDC_CTRL_SW_RST_MASK
Definition: hpm_lcdc_regs.h:48
#define LCDC_CTRL_DISP_ON_MASK
Definition: hpm_lcdc_regs.h:69
#define LCDC_BGND_CL_B_SET(x)
Definition: hpm_lcdc_regs.h:212
#define LCDC_LAYER_LAYSIZE_WIDTH_SET(x)
Definition: hpm_lcdc_regs.h:606
enum display_pixel_format display_pixel_format_t
display pixel format
enum display_yuv_format display_yuv_format_t
display yuv format
enum display_byteorder display_byteorder_t
display data byte order
uint32_t hpm_stat_t
Definition: hpm_common.h:126
#define MAKE_STATUS(group, code)
Definition: hpm_common.h:135
@ status_group_lcdc
Definition: hpm_common.h:151
static void lcdc_layer_set_next_buffer(LCDC_Type *ptr, uint32_t layer_index, uint32_t buffer)
Set next buffer for certain layer.
Definition: hpm_lcdc_drv.h:243
static void lcdc_layer_update_dimension(LCDC_Type *ptr, uint8_t layer_index, uint8_t width, uint8_t height)
Update specific layer dimension.
Definition: hpm_lcdc_drv.h:290
enum lcdc_layer_max_bytes_per_transfer lcdc_layer_max_bytes_per_transfer_t
struct lcdc_config lcdc_config_t
enum lcdc_display_mode lcdc_display_mode_t
static void lcdc_layer_update_position(LCDC_Type *ptr, uint8_t layer_index, uint16_t x, uint32_t y)
Update specific layer position.
Definition: hpm_lcdc_drv.h:273
lcdc_layer_max_bytes_per_transfer
Definition: hpm_lcdc_drv.h:53
static void lcdc_set_background(LCDC_Type *ptr, display_color_32b_t color)
Set background.
Definition: hpm_lcdc_drv.h:379
static uint32_t lcdc_get_dma_status(LCDC_Type *ptr)
Get DMA status.
Definition: hpm_lcdc_drv.h:178
static bool lcdc_layer_control_shadow_loaded(LCDC_Type *ptr, uint8_t layer_index)
Make layer control shadow registers take effect.
Definition: hpm_lcdc_drv.h:166
static void lcdc_set_testmode(LCDC_Type *ptr, uint8_t test_mode)
Set test mode.
Definition: hpm_lcdc_drv.h:365
static void lcdc_enable_interrupt(LCDC_Type *ptr, uint32_t interrupt_mask)
Enable interrupt according to the given mask.
Definition: hpm_lcdc_drv.h:130
struct lcdc_layer_config lcdc_layer_config_t
static void lcdc_layer_update_background(LCDC_Type *ptr, uint8_t layer_index, display_color_32b_t background)
Update specific layer background.
Definition: hpm_lcdc_drv.h:257
static void lcdc_layer_disable(LCDC_Type *ptr, uint32_t layer_index)
Disable specific layer.
Definition: hpm_lcdc_drv.h:351
static bool lcdc_check_status(LCDC_Type *ptr, uint32_t mask)
Check status against the given mask.
Definition: hpm_lcdc_drv.h:230
struct lcdc_xsync_config lcdc_xsync_config_t
struct lcdc_control lcdc_control_t
static void lcdc_clear_dma_status(LCDC_Type *ptr, uint32_t mask)
Clear DMA status according to the given mask.
Definition: hpm_lcdc_drv.h:204
static void lcdc_enable_background_in_alpha_blender(LCDC_Type *ptr)
enable background on alpha blender
Definition: hpm_lcdc_drv.h:395
void lcdc_turn_on_display(LCDC_Type *ptr)
Turn on display.
Definition: hpm_lcdc_drv.c:281
static bool lcdc_check_dma_status(LCDC_Type *ptr, uint32_t mask)
Check DMA status against the given mask.
Definition: hpm_lcdc_drv.h:192
void lcdc_get_default_layer_config(LCDC_Type *ptr, lcdc_layer_config_t *layer, display_pixel_format_t pixel_format, uint8_t layer_index)
Get default layer configuration value.
Definition: hpm_lcdc_drv.c:51
void lcdc_get_default_config(LCDC_Type *ptr, lcdc_config_t *config)
Get default configuration value.
Definition: hpm_lcdc_drv.c:113
static void lcdc_clear_status(LCDC_Type *ptr, uint32_t mask)
Clear specific status according to the given mask.
Definition: hpm_lcdc_drv.h:154
lcdc_line_pattern
Definition: hpm_lcdc_drv.h:35
static void lcdc_software_reset(LCDC_Type *ptr)
Layer config.
Definition: hpm_lcdc_drv.h:117
lcdc_display_mode
Definition: hpm_lcdc_drv.h:45
hpm_stat_t lcdc_config_layer(LCDC_Type *ptr, uint8_t layer_index, lcdc_layer_config_t *layer_config, bool enable_layer)
Configure specific layer.
Definition: hpm_lcdc_drv.c:192
static void lcdc_disable_background_in_alpha_blender(LCDC_Type *ptr)
disable background on alpha blender
Definition: hpm_lcdc_drv.h:408
static uint32_t lcdc_get_status(LCDC_Type *ptr)
Get status.
Definition: hpm_lcdc_drv.h:216
static void lcdc_layer_update(LCDC_Type *ptr, uint8_t layer_index)
Update specific layer configuration.
Definition: hpm_lcdc_drv.h:326
void lcdc_turn_off_display(LCDC_Type *ptr)
Turn off display.
Definition: hpm_lcdc_drv.c:261
static void lcdc_disable_interrupt(LCDC_Type *ptr, uint32_t interrupt_mask)
Disable interrupt according to the given mask.
Definition: hpm_lcdc_drv.h:142
static void lcdc_layer_enable(LCDC_Type *ptr, uint32_t layer_index)
Enable specific layer.
Definition: hpm_lcdc_drv.h:338
enum lcdc_line_pattern lcdc_line_pattern_t
void lcdc_init(LCDC_Type *ptr, lcdc_config_t *config)
Initialize LCD controller.
Definition: hpm_lcdc_drv.c:165
static void lcdc_layer_set_region(LCDC_Type *ptr, uint8_t layer_index, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
Update specific layer region.
Definition: hpm_lcdc_drv.h:309
@ status_lcdc_no_active_layer_yet
Definition: hpm_lcdc_drv.h:30
@ status_lcdc_layer_not_supported
Definition: hpm_lcdc_drv.h:31
@ lcdc_layer_max_bytes_512
Definition: hpm_lcdc_drv.h:57
@ lcdc_layer_max_bytes_1024
Definition: hpm_lcdc_drv.h:58
@ lcdc_layer_max_bytes_256
Definition: hpm_lcdc_drv.h:56
@ lcdc_layer_max_bytes_64
Definition: hpm_lcdc_drv.h:54
@ lcdc_layer_max_bytes_128
Definition: hpm_lcdc_drv.h:55
@ lcdc_line_pattern_gbr
Definition: hpm_lcdc_drv.h:38
@ lcdc_line_pattern_bgr
Definition: hpm_lcdc_drv.h:41
@ lcdc_line_pattern_rbg
Definition: hpm_lcdc_drv.h:37
@ lcdc_line_pattern_rgb
Definition: hpm_lcdc_drv.h:36
@ lcdc_line_pattern_grb
Definition: hpm_lcdc_drv.h:39
@ lcdc_line_pattern_brg
Definition: hpm_lcdc_drv.h:40
@ lcdc_display_mode_test_mode_2
Definition: hpm_lcdc_drv.h:48
@ lcdc_display_mode_normal
Definition: hpm_lcdc_drv.h:46
@ lcdc_display_mode_test_mode_3
Definition: hpm_lcdc_drv.h:49
@ lcdc_display_mode_test_mode_1
Definition: hpm_lcdc_drv.h:47
Definition: hpm_lcdc_regs.h:12
__RW uint32_t BGND_CL
Definition: hpm_lcdc_regs.h:14
struct LCDC_Type::@514 LAYER[8]
__RW uint32_t LAYCTRL
Definition: hpm_lcdc_regs.h:24
__RW uint32_t BG_CL
Definition: hpm_lcdc_regs.h:31
__W uint32_t DMA_ST
Definition: hpm_lcdc_regs.h:18
__RW uint32_t LAYPOS
Definition: hpm_lcdc_regs.h:27
__W uint32_t ST
Definition: hpm_lcdc_regs.h:19
__RW uint32_t CTRL
Definition: hpm_lcdc_regs.h:13
__RW uint32_t LAYSIZE
Definition: hpm_lcdc_regs.h:26
__RW uint32_t START0
Definition: hpm_lcdc_regs.h:28
__RW uint32_t INT_EN
Definition: hpm_lcdc_regs.h:20
display data alphablend option
Definition: hpm_display_common.h:102
display yuv to rgb format conversion config
Definition: hpm_display_common.h:126
Definition: hpm_lcdc_drv.h:80
uint16_t resolution_x
Definition: hpm_lcdc_drv.h:81
lcdc_control_t control
Definition: hpm_lcdc_drv.h:86
lcdc_xsync_config_t vsync
Definition: hpm_lcdc_drv.h:84
uint16_t resolution_y
Definition: hpm_lcdc_drv.h:82
lcdc_xsync_config_t hsync
Definition: hpm_lcdc_drv.h:83
display_color_32b_t background
Definition: hpm_lcdc_drv.h:85
Definition: hpm_lcdc_drv.h:62
bool invert_pixel_data
Definition: hpm_lcdc_drv.h:65
lcdc_display_mode_t display_mode
Definition: hpm_lcdc_drv.h:64
bool invert_hsync
Definition: hpm_lcdc_drv.h:69
bool invert_href
Definition: hpm_lcdc_drv.h:67
lcdc_line_pattern_t line_pattern
Definition: hpm_lcdc_drv.h:63
bool invert_pixel_clock
Definition: hpm_lcdc_drv.h:66
bool invert_vsync
Definition: hpm_lcdc_drv.h:68
Definition: hpm_lcdc_drv.h:90
display_yuv2rgb_config_t csc_config
Definition: hpm_lcdc_drv.h:96
uint16_t height
Definition: hpm_lcdc_drv.h:98
display_yuv_format_t yuv
Definition: hpm_lcdc_drv.h:93
display_color_32b_t background
Definition: hpm_lcdc_drv.h:102
display_pixel_format_t pixel_format
Definition: hpm_lcdc_drv.h:94
display_alphablend_option_t alphablend
Definition: hpm_lcdc_drv.h:95
uint16_t position_x
Definition: hpm_lcdc_drv.h:100
uint32_t stride
Definition: hpm_lcdc_drv.h:104
uint16_t width
Definition: hpm_lcdc_drv.h:99
display_byteorder_t byteorder
Definition: hpm_lcdc_drv.h:92
uint16_t position_y
Definition: hpm_lcdc_drv.h:101
uint32_t buffer
Definition: hpm_lcdc_drv.h:103
uint8_t max_ot
Definition: hpm_lcdc_drv.h:91
lcdc_layer_max_bytes_per_transfer_t max_bytes
Definition: hpm_lcdc_drv.h:97
Definition: hpm_lcdc_drv.h:73
uint16_t front_porch_pulse
Definition: hpm_lcdc_drv.h:74
uint16_t pulse_width
Definition: hpm_lcdc_drv.h:76
uint16_t back_porch_pulse
Definition: hpm_lcdc_drv.h:75
display data 32 bits argb
Definition: hpm_display_common.h:80
uint8_t b
Definition: hpm_display_common.h:83
uint32_t u
Definition: hpm_display_common.h:81
uint8_t r
Definition: hpm_display_common.h:85
uint8_t g
Definition: hpm_display_common.h:84