HPM SDK
HPMicro Software Development Kit
LCD driver APIs

LCD driver APIs. More...

Data Structures

struct  lcdc_control
 
struct  lcdc_xsync_config
 
struct  lcdc_config
 
struct  lcdc_layer_config
 

Macros

#define LCDC_TEST_MODE_DISABLE   (0U)
 
#define LCDC_TEST_MODE_BACKGROUND   (1U)
 
#define LCDC_TEST_MODE_COLOR_BAR_COL   (2U)
 
#define LCDC_TEST_MODE_COLOR_BAR_ROW   (3U)
 

Typedefs

typedef enum lcdc_line_pattern lcdc_line_pattern_t
 
typedef enum lcdc_display_mode lcdc_display_mode_t
 
typedef enum lcdc_layer_max_bytes_per_transfer lcdc_layer_max_bytes_per_transfer_t
 
typedef struct lcdc_control lcdc_control_t
 
typedef struct lcdc_xsync_config lcdc_xsync_config_t
 
typedef struct lcdc_config lcdc_config_t
 
typedef struct lcdc_layer_config lcdc_layer_config_t
 

Enumerations

enum  { status_lcdc_no_active_layer_yet = ((uint32_t)( status_group_lcdc )*1000U + (uint32_t)( 1 )) , status_lcdc_layer_not_supported = ((uint32_t)( status_group_lcdc )*1000U + (uint32_t)( 2 )) }
 
enum  lcdc_line_pattern {
  lcdc_line_pattern_rgb = 0 , lcdc_line_pattern_rbg , lcdc_line_pattern_gbr , lcdc_line_pattern_grb ,
  lcdc_line_pattern_brg , lcdc_line_pattern_bgr
}
 
enum  lcdc_display_mode { lcdc_display_mode_normal = 0 , lcdc_display_mode_test_mode_1 , lcdc_display_mode_test_mode_2 , lcdc_display_mode_test_mode_3 }
 
enum  lcdc_layer_max_bytes_per_transfer {
  lcdc_layer_max_bytes_64 = 0 , lcdc_layer_max_bytes_128 , lcdc_layer_max_bytes_256 , lcdc_layer_max_bytes_512 ,
  lcdc_layer_max_bytes_1024
}
 

Functions

static void lcdc_software_reset (LCDC_Type *ptr)
 Layer config. More...
 
static void lcdc_enable_interrupt (LCDC_Type *ptr, uint32_t interrupt_mask)
 Enable interrupt according to the given mask. More...
 
static void lcdc_disable_interrupt (LCDC_Type *ptr, uint32_t interrupt_mask)
 Disable interrupt according to the given mask. More...
 
static void lcdc_clear_status (LCDC_Type *ptr, uint32_t mask)
 Clear specific status according to the given mask. More...
 
static bool lcdc_layer_control_shadow_loaded (LCDC_Type *ptr, uint8_t layer_index)
 Make layer control shadow registers take effect. More...
 
static uint32_t lcdc_get_dma_status (LCDC_Type *ptr)
 Get DMA status. More...
 
static bool lcdc_check_dma_status (LCDC_Type *ptr, uint32_t mask)
 Check DMA status against the given mask. More...
 
static void lcdc_clear_dma_status (LCDC_Type *ptr, uint32_t mask)
 Clear DMA status according to the given mask. More...
 
static uint32_t lcdc_get_status (LCDC_Type *ptr)
 Get status. More...
 
static bool lcdc_check_status (LCDC_Type *ptr, uint32_t mask)
 Check status against the given mask. More...
 
static void lcdc_layer_set_next_buffer (LCDC_Type *ptr, uint32_t layer_index, uint32_t buffer)
 Set next buffer for certain layer. More...
 
static void lcdc_layer_update_background (LCDC_Type *ptr, uint8_t layer_index, display_color_32b_t background)
 Update specific layer background. More...
 
static void lcdc_layer_update_position (LCDC_Type *ptr, uint8_t layer_index, uint16_t x, uint32_t y)
 Update specific layer position. More...
 
static void lcdc_layer_update_dimension (LCDC_Type *ptr, uint8_t layer_index, uint8_t width, uint8_t height)
 Update specific layer dimension. More...
 
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. More...
 
static void lcdc_layer_update (LCDC_Type *ptr, uint8_t layer_index)
 Update specific layer configuration. More...
 
static void lcdc_layer_enable (LCDC_Type *ptr, uint32_t layer_index)
 Enable specific layer. More...
 
static void lcdc_layer_disable (LCDC_Type *ptr, uint32_t layer_index)
 Disable specific layer. More...
 
static void lcdc_set_testmode (LCDC_Type *ptr, uint8_t test_mode)
 Set test mode. More...
 
static void lcdc_set_background (LCDC_Type *ptr, display_color_32b_t color)
 Set background. More...
 
static void lcdc_enable_background_in_alpha_blender (LCDC_Type *ptr)
 enable background on alpha blender More...
 
static void lcdc_disable_background_in_alpha_blender (LCDC_Type *ptr)
 disable background on alpha blender More...
 
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. More...
 
void lcdc_get_default_config (LCDC_Type *ptr, lcdc_config_t *config)
 Get default configuration value. More...
 
void lcdc_init (LCDC_Type *ptr, lcdc_config_t *config)
 Initialize LCD controller. More...
 
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. More...
 
void lcdc_turn_on_display (LCDC_Type *ptr)
 Turn on display. More...
 
void lcdc_turn_off_display (LCDC_Type *ptr)
 Turn off display. More...
 

Detailed Description

LCD driver APIs.

Macro Definition Documentation

◆ LCDC_TEST_MODE_BACKGROUND

#define LCDC_TEST_MODE_BACKGROUND   (1U)

◆ LCDC_TEST_MODE_COLOR_BAR_COL

#define LCDC_TEST_MODE_COLOR_BAR_COL   (2U)

◆ LCDC_TEST_MODE_COLOR_BAR_ROW

#define LCDC_TEST_MODE_COLOR_BAR_ROW   (3U)

◆ LCDC_TEST_MODE_DISABLE

#define LCDC_TEST_MODE_DISABLE   (0U)

Typedef Documentation

◆ lcdc_config_t

◆ lcdc_control_t

◆ lcdc_display_mode_t

◆ lcdc_layer_config_t

◆ lcdc_layer_max_bytes_per_transfer_t

◆ lcdc_line_pattern_t

◆ lcdc_xsync_config_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

#include <drivers/inc/hpm_lcdc_drv.h>

Enumerator
status_lcdc_no_active_layer_yet 
status_lcdc_layer_not_supported 

◆ lcdc_display_mode

#include <drivers/inc/hpm_lcdc_drv.h>

Enumerator
lcdc_display_mode_normal 
lcdc_display_mode_test_mode_1 
lcdc_display_mode_test_mode_2 
lcdc_display_mode_test_mode_3 

◆ lcdc_layer_max_bytes_per_transfer

#include <drivers/inc/hpm_lcdc_drv.h>

Enumerator
lcdc_layer_max_bytes_64 
lcdc_layer_max_bytes_128 
lcdc_layer_max_bytes_256 
lcdc_layer_max_bytes_512 
lcdc_layer_max_bytes_1024 

◆ lcdc_line_pattern

#include <drivers/inc/hpm_lcdc_drv.h>

Enumerator
lcdc_line_pattern_rgb 
lcdc_line_pattern_rbg 
lcdc_line_pattern_gbr 
lcdc_line_pattern_grb 
lcdc_line_pattern_brg 
lcdc_line_pattern_bgr 

Function Documentation

◆ lcdc_check_dma_status()

static bool lcdc_check_dma_status ( LCDC_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Check DMA status against the given mask.

Parameters
[in]ptrLCD base address
[in]maskMask of expected DMA status
Return values
trueif all bits set to 1 in mask are set
falseif any bit set to 1 in mask is not set

◆ lcdc_check_status()

static bool lcdc_check_status ( LCDC_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Check status against the given mask.

Parameters
[in]ptrLCD base address
[in]maskMask of expected status
Return values
trueif all bits set to 1 in mask are set
falseif any bit set to 1 in mask is not set

◆ lcdc_clear_dma_status()

static void lcdc_clear_dma_status ( LCDC_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Clear DMA status according to the given mask.

Parameters
[in]ptrLCD base address
[in]maskMask of expected DMA status

◆ lcdc_clear_status()

static void lcdc_clear_status ( LCDC_Type ptr,
uint32_t  mask 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Clear specific status according to the given mask.

Parameters
[in]ptrLCD base address
[in]maskStatus mask of status to be cleared

◆ lcdc_config_layer()

hpm_stat_t lcdc_config_layer ( LCDC_Type ptr,
uint8_t  layer_index,
lcdc_layer_config_t layer_config,
bool  enable_layer 
)

#include <drivers/inc/hpm_lcdc_drv.h>

Configure specific layer.

Parameters
[in]ptrLCD base address
[in]layer_indextarget layer to be configured
[in]layer_configPointer of layer configuration struct buffer
[in]enable_layerSet true if the layer needs to be enabled right after being configured

◆ lcdc_disable_background_in_alpha_blender()

static void lcdc_disable_background_in_alpha_blender ( LCDC_Type ptr)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

disable background on alpha blender

Note
if not use background but want depend the the background color of the layer itself, can be use the API
Parameters
[in]ptrLCD base address

◆ lcdc_disable_interrupt()

static void lcdc_disable_interrupt ( LCDC_Type ptr,
uint32_t  interrupt_mask 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Disable interrupt according to the given mask.

Parameters
[in]ptrLCD base address
[in]interrupt_maskMask of interrupts to be disabled

◆ lcdc_enable_background_in_alpha_blender()

static void lcdc_enable_background_in_alpha_blender ( LCDC_Type ptr)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

enable background on alpha blender

Note
it not depend the background color of the layer itself. it can be used with lcdc_set_background API
Parameters
[in]ptrLCD base address

◆ lcdc_enable_interrupt()

static void lcdc_enable_interrupt ( LCDC_Type ptr,
uint32_t  interrupt_mask 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Enable interrupt according to the given mask.

Parameters
[in]ptrLCD base address
[in]interrupt_maskMask of interrupts to be enabled

◆ lcdc_get_default_config()

void lcdc_get_default_config ( LCDC_Type ptr,
lcdc_config_t config 
)

#include <drivers/inc/hpm_lcdc_drv.h>

Get default configuration value.

Parameters
[in]ptrLCD base address
[out]configPointer of configuration struct buffer

◆ lcdc_get_default_layer_config()

void lcdc_get_default_layer_config ( LCDC_Type ptr,
lcdc_layer_config_t layer,
display_pixel_format_t  pixel_format,
uint8_t  layer_index 
)

#include <drivers/inc/hpm_lcdc_drv.h>

Get default layer configuration value.

Parameters
[in]ptrLCD base address
[out]layerPointer of layer configuration struct buffer
[in]pixel_formatPixel format to be used for this layer
[in]layer_indextarget layer to be configured

◆ lcdc_get_dma_status()

static uint32_t lcdc_get_dma_status ( LCDC_Type ptr)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Get DMA status.

Parameters
[in]ptrLCD base address
Return values
DMAstatus

◆ lcdc_get_status()

static uint32_t lcdc_get_status ( LCDC_Type ptr)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Get status.

Parameters
[in]ptrLCD base address
Return values
currentstatus

◆ lcdc_init()

void lcdc_init ( LCDC_Type ptr,
lcdc_config_t config 
)

#include <drivers/inc/hpm_lcdc_drv.h>

Initialize LCD controller.

Parameters
[in]ptrLCD base address
[in]configPointer of configuration struct buffer

◆ lcdc_layer_control_shadow_loaded()

static bool lcdc_layer_control_shadow_loaded ( LCDC_Type ptr,
uint8_t  layer_index 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Make layer control shadow registers take effect.

Parameters
[in]ptrLCD base address
[in]layer_indexIndex of layer to be controlled

◆ lcdc_layer_disable()

static void lcdc_layer_disable ( LCDC_Type ptr,
uint32_t  layer_index 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Disable specific layer.

Parameters
[in]ptrLCD base address
[in]layer_indextarget layer to be configured

◆ lcdc_layer_enable()

static void lcdc_layer_enable ( LCDC_Type ptr,
uint32_t  layer_index 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Enable specific layer.

Parameters
[in]ptrLCD base address
[in]layer_indextarget layer to be configured

◆ lcdc_layer_set_next_buffer()

static void lcdc_layer_set_next_buffer ( LCDC_Type ptr,
uint32_t  layer_index,
uint32_t  buffer 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Set next buffer for certain layer.

Parameters
[in]ptrLCD base address
[in]layer_indextarget layer to be configured
[in]bufferdisplay buffer to be set

◆ lcdc_layer_set_region()

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 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Update specific layer region.

Parameters
[in]ptrLCD base address
[in]layer_indextarget layer to be configured
[in]x1X coord of the top left pixel
[in]y1Y coord of the top left pixel
[in]x2X coord of the bottom right pixel
[in]y2Y coord of the bottom right pixel

◆ lcdc_layer_update()

static void lcdc_layer_update ( LCDC_Type ptr,
uint8_t  layer_index 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Update specific layer configuration.

Parameters
[in]ptrLCD base address
[in]layer_indextarget layer to be configured

◆ lcdc_layer_update_background()

static void lcdc_layer_update_background ( LCDC_Type ptr,
uint8_t  layer_index,
display_color_32b_t  background 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Update specific layer background.

Parameters
[in]ptrLCD base address
[in]layer_indextarget layer to be configured
[in]backgroundcolor to be set as background

◆ lcdc_layer_update_dimension()

static void lcdc_layer_update_dimension ( LCDC_Type ptr,
uint8_t  layer_index,
uint8_t  width,
uint8_t  height 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Update specific layer dimension.

Parameters
[in]ptrLCD base address
[in]layer_indextarget layer to be configured
[in]widthWidth in pixel
[in]heightHeight in pixel

◆ lcdc_layer_update_position()

static void lcdc_layer_update_position ( LCDC_Type ptr,
uint8_t  layer_index,
uint16_t  x,
uint32_t  y 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Update specific layer position.

Parameters
[in]ptrLCD base address
[in]layer_indextarget layer to be configured
[in]xPosition X coord
[in]yPosition Y coord

◆ lcdc_set_background()

static void lcdc_set_background ( LCDC_Type ptr,
display_color_32b_t  color 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Set background.

Parameters
[in]ptrLCD base address
[in]colorbackground color

◆ lcdc_set_testmode()

static void lcdc_set_testmode ( LCDC_Type ptr,
uint8_t  test_mode 
)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Set test mode.

Parameters
[in]ptrLCD base address
[in]test_modetarget test mode to be enabled

◆ lcdc_software_reset()

static void lcdc_software_reset ( LCDC_Type ptr)
inlinestatic

#include <drivers/inc/hpm_lcdc_drv.h>

Layer config.

Parameters
[in]ptrLCD base address

◆ lcdc_turn_off_display()

void lcdc_turn_off_display ( LCDC_Type ptr)

#include <drivers/inc/hpm_lcdc_drv.h>

Turn off display.

Parameters
[in]ptrLCD base address

◆ lcdc_turn_on_display()

void lcdc_turn_on_display ( LCDC_Type ptr)

#include <drivers/inc/hpm_lcdc_drv.h>

Turn on display.

Parameters
[in]ptrLCD base address