bf0_hal_lcdc.h

Header file of LCD controller HAL module.

Author

Sifli software development team

Attention

Defines

MAX_LCDC_LAYER
HAL_RAMLESS_LCD_ENABLED
INVALID_TOTAL_WIDTH
RAMLESS_AUTO_REFR_CODE_SIZE_IN_WORD
LCDC_SUPPORT_LINE_DONE_IRQ
LCDC_SUPPORT_DPI
LCDC_DPI_MAX_WIDTH
FLIP_V_BY_AREA(v, a, b)
SPI_LCD_FLAG_DDR_DUMMY_CLOCK
LCDC_RESX_NEG_PULSE
LCDC_RESX_POS_PULSE
HAL_LCDC_ERROR_NONE

No error

HAL_LCDC_ERROR_TIMEOUT

Wait busy timeout error

HAL_LCDC_ERROR_OVERFLOW

Decompress buf overflow error

HAL_LCDC_ERROR_UNDERRUN

JDI/DPI under run error

HAL_LCDC_ERROR_HAL_LOCKED

HAL LCDC locked error

HAL_LCDC_IS_SPI_IF(lcd_itf)
HAL_LCDC_IS_AHB_IF(lcd_itf)
HAL_LCDC_IS_DBI_IF(lcd_itf)
HAL_LCDC_IS_DSI_IF(lcd_itf)
HAL_LCDC_IS_DSI_CMD_IF(lcd_itf)
HAL_LCDC_IS_DSI_VID_IF(lcd_itf)
HAL_LCDC_IS_DPI_IF(lcd_itf)
HAL_LCDC_IS_JDI_IF(lcd_itf)
HAL_LCDC_IS_JDI_PARALLEL_IF(lcd_itf)
HAL_LCDC_IS_JDI_SERIAL_IF(lcd_itf)
HAL_LCDC_IS_PTC_AUX_IF(lcd_itf)
HAL_LCDC_LOOKUP_TABLE_SIZE
HAL_LCDC_ReadU8Reg(lcdc, U8Reg, p_data, data_len)

Read data(s) from LCD register which address length is 8bit.

参数:
  • lcdc – LCD controller handle

  • U8Reg – Unsigned 8bit LCD register address

  • p_data – read back buffer

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_LCDC_ReadU16Reg(lcdc, U16Reg, p_data, data_len)

Read data(s) from LCD register which address length is 16bit.

参数:
  • lcdc – LCD controller handle

  • U16Reg – Unsigned 16bit LCD register address

  • p_data – read back buffer

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_LCDC_ReadU32Reg(lcdc, U32Reg, p_data, data_len)

Read data(s) from LCD register which address length is 32bit.

参数:
  • lcdc – LCD controller handle

  • U32Reg – Unsigned 32bit LCD register address

  • p_data – read back buffer

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_LCDC_WriteU8Reg(lcdc, U8Reg, p_data, data_len)

Write data(s) to LCD register which address length is 8bit.

参数:
  • lcdc – LCD controller handle

  • U8Reg – Unsigned 8bit LCD register address

  • p_data – read back buffer

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_LCDC_WriteU16Reg(lcdc, U16Reg, p_data, data_len)

Write data(s) to LCD register which address length is 16bit.

参数:
  • lcdc – LCD controller handle

  • U16Reg – Unsigned 16bit LCD register address

  • p_data – read back buffer

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_LCDC_WriteU32Reg(lcdc, U32Reg, p_data, data_len)

Write data(s) to LCD register which address length is 32bit.

参数:
  • lcdc – LCD controller handle

  • U32Reg – Unsigned 32bit LCD register address

  • p_data – read back buffer

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_LCDC_SendLayerData_IT(lcdc)

Start write layer data DMA mode directly.

参数:
  • lcdc – LCD controller handle

返回值:

HAL – status

HAL_LCDC_SendLayerData(lcdc)
HAL_LCDC_RAMLESS_Init(hlcdc, ptc_buf)
HAL_LCDC_RAMLESS_Start(lcdc)

Start RAMLESS HW FSM.

参数:
  • lcdc – LCD controller handle

返回值:

HAL – status

HAL_LCDC_RAMLESS_Stop(lcdc)

Stop HW FSM.

参数:
  • lcdc – LCD controller handle

返回值:

HAL – status

Typedefs

typedef struct __LCDC_HandleTypeDef LCDC_HandleTypeDef

Enums

enum HAL_LCDC_IF_TypeDef

Values:

enumerator LCDC_INTF_DBI_8BIT_A

MIPI DBI type A interface(8080 8-bit Clocked E mode)

enumerator LCDC_INTF_DBI_8BIT_B

MIPI DBI type B interface(8080 8-bit)

enumerator LCDC_INTF_AHB

output to AHB buffer (RAM/PSRAM)

enumerator LCDC_INTF_SPI_START
enumerator LCDC_INTF_SPI_DCX_1DATA

SPI which has DCX pin, output with 1 data line.

enumerator LCDC_INTF_SPI_DCX_2DATA

SPI which has DCX pin, output with 2 data line.

enumerator LCDC_INTF_SPI_DCX_4DATA

SPI which has DCX pin, output with 4 data line.

enumerator LCDC_INTF_SPI_DCX_4DATA_AUX

SPI which has DCX pin, output with 4 data line(Drive by PTC)

enumerator LCDC_INTF_SPI_DCX_DDR_4DATA

SPI which has DCX pin, output with 4 data line(DDR)

enumerator LCDC_INTF_SPI_RSVD
enumerator LCDC_INTF_SPI_NODCX_1DATA

SPI which has NO DCX pin, output with 1 data line.

enumerator LCDC_INTF_SPI_NODCX_2DATA

SPI which has NO DCX pin, output with 2 data line.

enumerator LCDC_INTF_SPI_NODCX_4DATA

SPI which has NO DCX pin, output with 4 data line.

enumerator LCDC_INTF_SPI_RSVD2
enumerator LCDC_INTF_SPI_END
enumerator LCDC_INTF_DSI

DSI interface(Command mode)

enumerator LCDC_INTF_DSI_VIDEO

DSI video interface.

enumerator LCDC_INTF_DPI

DPI interface.

enumerator LCDC_INTF_DPI_AUX

DPI interface(Drive by PTC)

enumerator LCDC_INTF_JDI_SERIAL

JDI serial interface.

enumerator LCDC_INTF_JDI_PARALLEL

JDI parallel interface.

enumerator LCDC_INTF_NUM
enum HAL_LCDC_PixelFormat

Values:

enumerator LCDC_PIXEL_FORMAT_MONO
enumerator LCDC_PIXEL_FORMAT_RGB332
enumerator LCDC_PIXEL_FORMAT_RGB565
enumerator LCDC_PIXEL_FORMAT_RGB666
enumerator LCDC_PIXEL_FORMAT_RGB888
enumerator LCDC_PIXEL_FORMAT_ARGB888
enumerator LCDC_PIXEL_FORMAT_ARGB565
enumerator LCDC_PIXEL_FORMAT_A8
enumerator LCDC_PIXEL_FORMAT_L8
enumerator LCDC_PIXEL_FORMAT_RGB565_SWAP
enum HAL_LCDC_SyncTypeDef

Values:

enumerator HAL_LCDC_SYNC_DISABLE

disable frame synchronization

enumerator HAL_LCDC_SYNC_VER

only vsync signal mode, pulse trigger default

enumerator HAL_LCDC_SYNC_VERHOR

vsync mixed hsync signal mode, edge trigger default

enum HAL_LCDC_StateTypeDef

HAL LCDC State structures definition.

Values:

enumerator HAL_LCDC_STATE_RESET

LCDC not yet initialized or disabled

enumerator HAL_LCDC_STATE_READY

Peripheral Initialized and ready for use

enumerator HAL_LCDC_STATE_BUSY

An internal process is ongoing

enumerator HAL_LCDC_STATE_TIMEOUT

Timeout state

enumerator HAL_LCDC_STATE_ERROR

LCDC state error

enumerator HAL_LCDC_STATE_SUSPEND

LCDC process is suspended

enumerator HAL_LCDC_STATE_LOWPOWER

LCDC enter low power mode

enum HAL_LCDC_LayerDef

Values:

enumerator HAL_LCDC_LAYER_0

Layer 0, support compressed buffer.

enumerator HAL_LCDC_LAYER_DEFAULT

Default layer.

enumerator HAL_LCDC_LAYER_1

Layer 1 is upon layer 1, NOT support compressed buffer.

enumerator HAL_LCDC_LAYER_MAX
enum HAL_LCDC_RotateDef

Values:

enumerator HAL_LCDC_ROTATE_0
enumerator HAL_LCDC_ROTATE_180
enum SOFT_SPI_PIN_Def

Values:

enumerator SW_SPI_CS
enumerator SW_SPI_CLK
enumerator SW_SPI_D0
enumerator SW_SPI_D1
enumerator SW_SPI_D2
enumerator SW_SPI_D3
enumerator SW_SPI_DCX
enum SOFT_SPI_IO_Def

Values:

enumerator SW_SPI_INPUT
enumerator SW_SPI_OUTPUT

Functions

HAL_StatusTypeDef HAL_LCDC_Init(LCDC_HandleTypeDef *lcdc)

Initialize LCD controller hardware.

参数:
  • lcdc – LCD controller handle

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_DeInit(LCDC_HandleTypeDef *lcdc)

De-Initialize LCD controller hardware.

参数:
  • lcdc – LCD controller handle

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_ResetLCD(LCDC_HandleTypeDef *lcdc, uint8_t pulse_type, uint32_t pulse_us)
HAL_StatusTypeDef HAL_LCDC_Reset(LCDC_HandleTypeDef *lcdc)

Reset LCD controller hardware.

参数:
  • lcdc – LCD controller handle

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_SetOutFormat(LCDC_HandleTypeDef *lcdc, HAL_LCDC_PixelFormat format)

Change LCDC output format.

参数:
  • lcdc – - LCD controller handle

  • format – - LCDC output format

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_SetFreq(LCDC_HandleTypeDef *lcdc, uint32_t freq)

Update LCDC output frequecy.

参数:
  • lcdc – - LCD controller handle

  • freq – - Frequency in Hz

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_SetROI(LCDC_HandleTypeDef *lcdc, LCDC_AreaDef *area)

Set LCDC output ROI area by an area pointer.

参数:
  • lcdc – - LCD controller handle

  • area – - ROI area

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_SetROIArea(LCDC_HandleTypeDef *lcdc, uint16_t x_0, uint16_t y_0, uint16_t x_1, uint16_t y_1)

Set LCDC output ROI area by coordinate.

参数:
  • lcdc – - LCD controller handle

  • x_0 – - ROI area left to LCD top-left pixels

  • x_1 – - ROI area right to LCD top-left pixels

  • y_0 – - ROI area top to LCD top-left pixels

  • y_1 – - ROI area bottom to LCD top-left pixels

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerReset(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx)

Reset layer configuration.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerSetCmpr(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx, uint8_t cmpr)

Setup layer buffer compression ratio.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

  • cmpr – - Layer buffer compression ratio

返回:

HAL status

uint8_t HAL_LCDC_LayerGetCmpr(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx)

Get layer buffer compression ratio.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

返回:

compression ratio

HAL_StatusTypeDef HAL_LCDC_LayerSetFormat(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx, HAL_LCDC_PixelFormat format)

Ser layer buffer color format.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

  • format – - Buffer format

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerSetData(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx, uint8_t *pData, uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1)

Set layer buffer data and it’s coordinate.

参数:
  • lcdc – LCD controller handle

  • pData – - Layer data

  • x0 – - Layer left to LCD top-left pixels

  • x1 – - Layer right to LCD top-left pixels

  • y0 – - Layer top to LCD top-left pixels

  • y1 – - Layer bottom to LCD top-left pixels

  • layeridx – - Layer index

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerSetDataExt(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx, uint8_t *pData, uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t total_width)

Set layer buffer data and it’s coordinate.

参数:
  • lcdc – LCD controller handle

  • pData – - Layer data

  • x0 – - Layer left to LCD top-left pixels

  • x1 – - Layer right to LCD top-left pixels

  • y0 – - Layer top to LCD top-left pixels

  • y1 – - Layer bottom to LCD top-left pixels

  • total_width – - Layer original data width in pixels

  • layeridx – - Layer index

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerSetBgColor(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx, uint8_t r, uint8_t g, uint8_t b)

Set layer background color (It is visible only while blended with LCDC_PIXEL_FORMAT_A8 layer format for now)

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

  • r – red[0~255]

  • g – green[0~255]

  • b – blue[0~255]

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerSetLTab(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx, const LCDC_AColorDef *pLTab)

Set layer’s look up table.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

  • pLTab – - Look up table

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerEnableChromaKey(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx, uint8_t r, uint8_t g, uint8_t b)

Set layer chroma key color.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

  • r – red[0~255]

  • g – green[0~255]

  • b – blue[0~255]

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerDisableChromaKey(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx)

Disable layer chroma key.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerEnableAlpha(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx, uint8_t alpha)

Set layer global alpha value and enable it.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

  • alpha – - Layer alpha value[0~255]

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerDisableAlpha(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx)

Disable layer’s global alpha.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerRotate(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx, HAL_LCDC_RotateDef angle)

Set sepcified layer’s rotate angle.

参数:
  • lcdc – - LCD controller handle

  • layeridx – - Layer index

  • angle – - Rotate angle

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerVMirror(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx, bool en)

Enable layer.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

  • en – - enable

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerEnable(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx)

Enable layer.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_LayerDisable(LCDC_HandleTypeDef *lcdc, HAL_LCDC_LayerDef layeridx)

Disable layer.

参数:
  • lcdc – LCD controller handle

  • layeridx – - Layer index

返回:

HAL status

HAL_StatusTypeDef HAL_LCDC_SetBgColor(LCDC_HandleTypeDef *lcdc, uint8_t r, uint8_t g, uint8_t b)

Set background color (RGB888 format)

参数:
  • lcdc – LCD controller handle

  • r – red[0~255]

  • g – green[0~255]

  • b – blue[0~255]

返回:

HAL status

void HAL_LCDC_IRQHandler(LCDC_HandleTypeDef *lcdc)

LCD controller interrupt handler.

参数:
  • lcdc – LCD controller handle

返回值:

None

void HAL_LCDC_TE_IRQHandler(LCDC_HandleTypeDef *lcdc)

Send layer data when TE comming.

参数:
  • lcdc – LCD controller handle

返回值:

None

HAL_StatusTypeDef HAL_LCDC_ReadDatas(LCDC_HandleTypeDef *lcdc, uint32_t addr, uint32_t addr_len, uint8_t *p_data, uint32_t data_len)

Read data(s) from LCD register.

参数:
  • lcdc – LCD controller handle

  • addr – LCD register address(For example: 0x12345678 will be sent as 0x12, 0x34, 0x56, 0x78)

  • addr_len – - LCD register address length

  • p_data – read back buffer

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_WriteDatas(LCDC_HandleTypeDef *lcdc, uint32_t addr, uint32_t addr_len, uint8_t *p_data, uint32_t data_len)

Write data(s) to LCD register.

参数:
  • lcdc – LCD controller handle

  • addr – LCD register address(For example: 0x12345678 will be sent as 0x12, 0x34, 0x56, 0x78)

  • addr_len – - LCD address register length

  • p_data – read back buffer

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_LCDC_IF_TypeDef HAL_LCDC_SetSPICfg(LCDC_HandleTypeDef *lcdc, HAL_LCDC_IF_TypeDef config)

Set SPI interface configuration.

参数:
  • lcdc – LCD controller handle

  • config – SPI interface type, must between LCDC_INTF_SPI_START and LCDC_INTF_SPI_END

返回值:

Previous – LCDC interface configuration

HAL_StatusTypeDef HAL_LCDC_SendLayerData2Reg_IT(LCDC_HandleTypeDef *lcdc, uint32_t addr, uint32_t addr_len)

Send an address and layer data to LCD in asynchronized mode.

参数:
  • lcdc – LCD controller handle

  • addr – - Address to send

  • addr_len – - Address length in byte

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_SendLayerData2Reg(LCDC_HandleTypeDef *lcdc, uint32_t addr, uint32_t addr_len)

Send an address and layer data to LCD in synchronized mode.

参数:
  • lcdc – LCD controller handle

  • addr – - Address to send

  • addr_len – - Address length in byte

返回值:

HAL – status

void HAL_LCDC_SendLayerDataCpltCbk(LCDC_HandleTypeDef *lcdc)

LCD controller send layer data complete callback.

参数:
  • lcdc – LCD controller handle

返回值:

None

void HAL_LCDC_SendLineCpltCbk(LCDC_HandleTypeDef *lcdc, uint32_t line)

LCD controller sent lines(Base on HAL_LCDC_SetROIArea’s y0) complete callback.

参数:
  • lcdc – LCD controller handle

  • line – Sent lines

返回值:

None

void HAL_LCDC_Next_Frame_TE(LCDC_HandleTypeDef *lcdc, bool en)

Setup next frame’s TE, auto restore to default TE after send framebuffer.

参数:
  • lcdc – LCD controller handle

  • en – enable TE if ture

返回值:

None

void HAL_LCDC_Enable_TE(LCDC_HandleTypeDef *lcdc, bool en)

Enable/Disable TE.

参数:
  • lcdc – LCD controller handle

  • en – enable TE if ture

返回值:

None

HAL_StatusTypeDef HAL_LCDC_Enter_LP(LCDC_HandleTypeDef *lcdc)

Let LCDC enter low power mode.

参数:
  • lcdc – LCD controller handle

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_Exit_LP(LCDC_HandleTypeDef *lcdc)

Wake up LCDC from low power mode.

参数:
  • lcdc – LCD controller handle

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_Resume(LCDC_HandleTypeDef *lcdc)

Resume LCDC all registers from standby mode.

参数:
  • lcdc – LCD controller handle

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_RAMLESS_Init_Ext(LCDC_HandleTypeDef *lcdc, uint32_t *ptc_buf, uint8_t *sram_buf0, uint8_t *sram_buf1, uint32_t sram_buf_bytes)

Initial RAMLESS HW FSM.

参数:
  • lcdc – LCD controller handle

  • ptc_buf – - Pointer to buffer for saving HW auto refresh code, size is RAMLESS_AUTO_REFR_CODE_SIZE_IN_WORD

  • sram_buf0 – - Ping-Pong buffer for DPI

  • sram_buf1 – - Ping-Pong buffer for DPI

  • sram_buf_bytes – - Ping-Pong buffer size

返回值:

HAL – status

void HAL_RAMLESS_LCD_IRQHandler(LCDC_HandleTypeDef *lcdc)
HAL_StatusTypeDef HAL_LCDC_RAMLESS_ReadDatasStart(LCDC_HandleTypeDef *lcdc, uint32_t freq, uint32_t addr, uint32_t addr_len, uint32_t data_len)

Commit an reading LCD register action during RAMLESS HW FSM working.

参数:
  • lcdc – LCD controller handle

  • freq – The frequency of reading

  • addr – LCD register address(For example: 0x12345678 will be sent as 0x12, 0x34, 0x56, 0x78)

  • addr_len – - LCD register address length

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_RAMLESS_ReadDatasEnd(LCDC_HandleTypeDef *lcdc, uint8_t *p_data, uint32_t data_len)

Get the result of last committed reading action.

参数:
  • lcdc – LCD controller handle

  • p_data – read back buffer

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_RAMLESS_WriteDatasStart(LCDC_HandleTypeDef *lcdc, uint32_t addr, uint32_t addr_len, uint8_t *p_data, uint32_t data_len)

Commit an writing register action during RAMLESS HW FSM working.

参数:
  • lcdc – LCD controller handle

  • addr – LCD register address(For example: 0x12345678 will be sent as 0x12, 0x34, 0x56, 0x78)

  • addr_len – - LCD register address length

  • p_data – read back buffer

  • data_len – read back buffer size in byte

返回值:

HAL – status

HAL_StatusTypeDef HAL_LCDC_RAMLESS_WriteDatasEnd(LCDC_HandleTypeDef *lcdc)

Get the result of last committed writing action.

参数:
  • lcdc – LCD controller handle

返回值:

HAL – status

void HAL_LCD_LineIRQHandler(LCDC_HandleTypeDef *lcdc)
void HAL_LCDC_PTC_IRQHandler(LCDC_HandleTypeDef *lcdc)
void HAL_LCDC_SoftSpiInit(SOFT_SPI_PIN_Def pin, SOFT_SPI_IO_Def inout, uint32_t high1low0)
void HAL_LCDC_SoftSpiDeinit(SOFT_SPI_PIN_Def pin)
uint32_t HAL_LCDC_SoftSpiGetPin(SOFT_SPI_PIN_Def pin)
void HAL_LCDC_SoftSpiSetPin(SOFT_SPI_PIN_Def pin, uint32_t high1low0)
uint32_t HAL_LCDC_SoftSPI_Read(LCDC_HandleTypeDef *lcdc, uint32_t addr, uint32_t addr_len, uint32_t data_len)
struct DBI_LCD_CFG

Public Members

uint8_t RD_polarity

Read signal pin polarity.

uint8_t WR_polarity

Write signal pin polarity.

uint8_t RS_polarity

Reset signal pin polarity.

uint8_t CS_polarity

CS signal pin polarity.

uint8_t reserved
HAL_LCDC_SyncTypeDef syn_mode

vsyn only | vsyn + hsyn mixed | disable

uint32_t vsyn_polarity

TE pin polarity: 0 - high active and 1 - low active

uint32_t vsyn_delay_us

The delay us to send frame buffer right after received TE signal

uint32_t hsyn_num

Hsync signal num between two vsync signal

struct AHB_LCD_Cfg

Public Members

uint32_t lcd_mem

address for AHB LCD/ AHB RAM

uint32_t lcd_o_width

AHB RAM address offset for each line

struct SPI_LCD_Cfg

Public Members

uint32_t dummy_clock

Dummy clock between cmd & data in read mode.

HAL_LCDC_SyncTypeDef syn_mode

vsyn only | vsyn + hsyn mixed | disable

uint32_t cs_polarity

CS pin polarity: 0 - low active and 1 - high active

uint32_t clk_polarity

CLK pin polarity(CPOL): 0 - low and 1 - high

uint32_t clk_phase

CLK pin phase(CPHA): 0 - phase 0 and 1 - phase 1

uint32_t vsyn_polarity

TE pin polarity: 0 - falling edge and 1 - rasing edge

uint32_t reserved
uint32_t vsyn_delay_us

The delay us to send frame buffer right after received TE signal

uint32_t hsyn_num

Hsync signal num between two vsync signal

uint32_t bytes_gap_us

Set 0 by default. The minimal gap between every byte, but not for multi pixel writting.

uint32_t readback_from_Dx

0 read back data from D0 (HW SPI support), 1~3 read back from D1~D3(Software SPI support before 52x).

uint32_t flags
uint32_t frame_cmd
uint32_t frame_gap

Gap after every frame, In microsecond.

uint32_t porch_cmd
uint32_t line_cmd
uint32_t porch_line_gap

Gap after every porch line, In microsecond.

uint32_t data_line_gap

Gap after every data line, In microsecond.

uint32_t front_porch

Front porch line.

uint32_t back_porch

Back porch line(The frame start will be treated as a porch line)

uint8_t backlight_pwm

Output pwm output enable percent.

uint8_t backlight_polarity

Output polarity.

struct JDI_LCD_CFG

Public Members

uint16_t bank_col_head
uint16_t valid_columns
uint16_t bank_col_tail
uint16_t bank_row_head
uint16_t valid_rows
uint16_t bank_row_tail
struct DPI_LCD_CFG

Public Members

uint8_t PCLK_polarity

Pixel clock pin polarity.

uint8_t DE_polarity

Data enable signal pin polarity.

uint8_t VS_polarity

VSYNC signal pin polarity.

uint8_t HS_polarity

HSYNC signal pin polarity.

uint8_t PCLK_force_on

Never stop PCLK during.

uint8_t reserved
uint16_t VS_width

VSYNC pulse width, in HSYNC clock(VLW).

uint16_t HS_width

HSYNC pulse width, in Pixel clock(HLW).

uint16_t VBP

in HSYNC clock

uint16_t VAH
uint16_t VFP
uint16_t HBP

in Pixel clock

uint16_t HAW
uint16_t HFP
uint16_t interrupt_line_num
struct LCDC_InitTypeDef

Public Members

HAL_LCDC_IF_TypeDef lcd_itf

LCD HW connection interface .

uint32_t freq

Interface clock frequency.

HAL_LCDC_PixelFormat color_mode

The color format of LCDC output

DBI_LCD_CFG dbi

DBI LCD interface config

AHB_LCD_Cfg ahb

AHB LCD interface config

SPI_LCD_Cfg spi

SPI LCD interface config

JDI_LCD_CFG jdi

JDI LCD interface config

DPI_LCD_CFG dpi

DPI LCD interface config

union LCDC_InitTypeDef.[anonymous] cfg

LCD interface config union

struct LCDC_ColorDef
#include <bf0_hal_lcdc.h>

LCDC color structure definition.

Public Members

uint8_t r
uint8_t g
uint8_t b
struct LCDC_AColorDef
#include <bf0_hal_lcdc.h>

LCDC alpha color structure definition.

Public Members

uint8_t a
uint8_t r
uint8_t g
uint8_t b
struct LCDC_AreaDef
#include <bf0_hal_lcdc.h>

LCDC area structure definition.

Public Members

uint16_t x0
uint16_t y0
uint16_t x1
uint16_t y1
struct LCDC_LayerCfgTypeDef
#include <bf0_hal_lcdc.h>

LCDC Layer structure definition.

Public Members

uint8_t *data

Layer buffer ptr.

HAL_LCDC_PixelFormat data_format

Layer data pixel format.

LCDC_ColorDef chroma_key

Layer chroma key color.

LCDC_ColorDef bg_color

Layer background color for A8 format data only.

const LCDC_AColorDef *lookup_table

Layer lookup table for L8 format, it’s length must be 256*sizeof(LCDC_AColorDef)

LCDC_AreaDef data_area

Layer data position (Origin is LCD top-left, same as below)

uint16_t total_width

Layer original line width in pixels. Equals to INVALID_TOTAL_WIDTH if use ‘data_area’ width instead.

uint8_t cmpr_rate

Layer buffer’s compress rate.

uint8_t alpha

Layer alpha value.

uint16_t cmpr_en

Layer buffer is compressed.

uint16_t chroma_key_en

Enable layer chroma key.

uint16_t layer_alpha_en

Use layer alpha if enabled.

uint16_t disable

Disable layer.

uint16_t h_mirror

Horizontal mirror.

uint16_t v_mirror

Vertical mirror.

uint16_t reserved
struct __LCDC_HandleTypeDef

Public Members

LCD_IF_TypeDef *Instance

LCDC register base address.

LCDC_InitTypeDef Init

LCDC communication parameters.

LCDC_LayerCfgTypeDef Layer[HAL_LCDC_LAYER_MAX]

LCDC layer parameters.

void (*XferCpltCallback)(struct __LCDC_HandleTypeDef *lcdc)

LCDC transfer complete callback.

void (*XferErrorCallback)(struct __LCDC_HandleTypeDef *lcdc)

LCDC transfer error callback.

void (*XferLineCallback)(struct __LCDC_HandleTypeDef *lcdc, uint32_t line_num)

LCDC transfer line done callback.

uint16_t irq_lines

Call ‘XferLineCallback’ every ‘irq_lines’ were transferred.

uint32_t *ptc_code
uint32_t need_cplt_ckb
uint8_t running

ptc_code is running

uint8_t *sram_buf0
uint8_t *sram_buf1
uint32_t sram_buf_bytes
LCDC_AreaDef roi

Clip area position (Origin is LCD top-left, same as below)

LCDC_ColorDef bg

LCDC default background color.

HAL_LockTypeDef Lock

LCDC lock.

HAL_LCDC_StateTypeDef State

LCDC transfer state.

uint32_t ErrorCode

LCDC error code.

uint8_t Next_Frame_TE

The TE configuration of Next Frame

uint32_t use_lcdc2_te

Use LCDC2 ‘TE in LCDC1

uint32_t reversed
uint32_t debug_cnt0
uint32_t debug_cnt1
uint32_t debug_cnt2