![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.000
NXP Semiconductors
|
The MCUXpresso SDK provides a peripheral driver for the LCD interface (LCDIF) module of MCUXpresso SDK devices.
Data Structures | |
| struct | lcdif_dpi_config_t |
| Configuration for LCDIF module to work in DBI mode. More... | |
| struct | lcdif_fb_config_t |
| LCDIF frame buffer configuration. More... | |
| struct | lcdif_cursor_config_t |
| LCDIF cursor configuration. More... | |
| struct | lcdif_dither_config_t |
| LCDIF dither configuration. More... | |
| struct | lcdif_dbi_config_t |
| LCDIF DBI configuration. More... | |
Macros | |
| #define | LCDIF_MAKE_CURSOR_COLOR(r, g, b) (((r) << 16U) | ((g) << 8U) | ((b) << 0U)) |
| Construct the cursor color, every element should be in the range of 0 ~ 255. More... | |
| #define | LCDIF_MAKE_GAMMA_VALUE(r, g, b) (((r) << 16U) | ((g) << 8U) | ((b) << 0U)) |
| Construct the gamma value set to LCDIF gamma table, every element should be in the range of 0~255. More... | |
| #define | LCDIF_ALIGN_ADDR(addr, align) (((addr) + (align)-1U) & ~((align)-1U)) |
| Calculate the aligned address for LCDIF buffer. More... | |
| #define | LCDIF_FB_ALIGN 128U |
| The frame buffer should be 128 byte aligned. More... | |
| #define | LCDIF_GAMMA_INDEX_MAX 256U |
| Gamma index max value. More... | |
| #define | LCDIF_CURSOR_SIZE 32U |
| The cursor size is 32 x 32. | |
Driver version | |
| #define | FSL_LCDIF_DRIVER_VERSION (MAKE_VERSION(2, 2, 0)) |
Initialization and deinitialization | |
| status_t | LCDIF_Init (LCDIF_Type *base) |
| Initialize the LCDIF. More... | |
| void | LCDIF_Deinit (LCDIF_Type *base) |
| De-initialize the LCDIF. More... | |
DPI mode | |
| void | LCDIF_DpiModeGetDefaultConfig (lcdif_dpi_config_t *config) |
| Get the default configuration for to initialize the LCDIF. More... | |
| status_t | LCDIF_DpiModeSetConfig (LCDIF_Type *base, uint8_t displayIndex, const lcdif_dpi_config_t *config) |
| Initialize the LCDIF to work in DPI mode. More... | |
DBI mode | |
| status_t | LCDIF_DbiModeSetConfig (LCDIF_Type *base, uint8_t displayIndex, const lcdif_dbi_config_t *config) |
| Initialize the LCDIF to work in DBI mode. More... | |
| void | LCDIF_DbiModeGetDefaultConfig (lcdif_dbi_config_t *config) |
| Get the default configuration to initialize the LCDIF DBI mode. More... | |
| static void | LCDIF_DbiReset (LCDIF_Type *base, uint8_t displayIndex) |
| Reset the DBI module. More... | |
| void | LCDIF_DbiSelectArea (LCDIF_Type *base, uint8_t displayIndex, uint16_t startX, uint16_t startY, uint16_t endX, uint16_t endY, bool isTiled) |
| Select the update area in DBI mode. More... | |
| static void | LCDIF_DbiSendCommand (LCDIF_Type *base, uint8_t displayIndex, uint8_t cmd) |
| Send command to DBI port. More... | |
| void | LCDIF_DbiSendData (LCDIF_Type *base, uint8_t displayIndex, const uint8_t *data, uint32_t dataLen_Byte) |
| brief Send data to DBI port. More... | |
| void | LCDIF_DbiSendCommandAndData (LCDIF_Type *base, uint8_t displayIndex, uint8_t cmd, const uint8_t *data, uint32_t dataLen_Byte) |
| Send command followed by data to DBI port. More... | |
| static void | LCDIF_DbiWriteMem (LCDIF_Type *base, uint8_t displayIndex) |
| Send pixel data in frame buffer to panel controller memory. More... | |
Frame buffer | |
| void | LCDIF_SetFrameBufferConfig (LCDIF_Type *base, uint8_t displayIndex, const lcdif_fb_config_t *config) |
| Configure the LCDIF frame buffer. More... | |
| void | LCDIF_FrameBufferGetDefaultConfig (lcdif_fb_config_t *config) |
| Get default frame buffer configuration. More... | |
| static void | LCDIF_SetFrameBufferAddr (LCDIF_Type *base, uint8_t displayIndex, uint32_t address) |
| Set the frame buffer to LCDIF. More... | |
| void | LCDIF_SetFrameBufferStride (LCDIF_Type *base, uint8_t displayIndex, uint32_t strideBytes) |
| Set the frame buffer stride. More... | |
Dither | |
| void | LCDIF_SetDitherConfig (LCDIF_Type *base, uint8_t displayIndex, const lcdif_dither_config_t *config) |
| Set the dither configuration. More... | |
Gamma correction | |
| void | LCDIF_SetGammaData (LCDIF_Type *base, uint8_t displayIndex, uint16_t startIndex, const uint32_t *gamma, uint16_t gammaLen) |
| Set the gamma translation values to the LCDIF gamma table. More... | |
Interrupts | |
The interrupt must be enabled, otherwise the interrupt flags will not assert. | |
| static void | LCDIF_EnableInterrupts (LCDIF_Type *base, uint32_t mask) |
| Enables LCDIF interrupt requests. More... | |
| static void | LCDIF_DisableInterrupts (LCDIF_Type *base, uint32_t mask) |
| Disable LCDIF interrupt requests. More... | |
| static uint32_t | LCDIF_GetAndClearInterruptPendingFlags (LCDIF_Type *base) |
| Get and clear LCDIF interrupt pending status. More... | |
Cursor | |
Top-left point and Hot spot are two different cursor point. Top-left point is used as the base address for the cursor. Hot spot is used in a search for a corresponding screen coordinate when a selection is made, such as when the "Enter" key or left mouse button is pushed. Top-left point
+-------------------------------+
| |
| Hot spot |
| +------- |
| | \ |
| | \ \ |
| | \ \ |
| \ \ |
| \ \ |
| \ \ |
| \ \ |
| \ |
| |
+-------------------------------+For format masked, one cursor pixel is 2bits. 32x32 cursor pixels have 32 cursor color rows. Each cursor color row is 64bits. cursorColorRow_H[31:0] = colorRow[63:32] cursorColorRow_L[31:0] = colorRow[31:0] xorCursor = cursorColorRow_H[cursorXPos[4:0]] andCursor = cursorColorRow_L[cursorXPos[4:0]] The output cursor color is: andCursor xorCursor cursor color 0 0 Background register color 0 1 Foreground register color 1 0 Frame buffer pixel color 1 1 Invert frame buffer pixel color | |
| void | LCDIF_CursorGetDefaultConfig (lcdif_cursor_config_t *config) |
| Get the hardware cursor default configuration. More... | |
| void | LCDIF_SetCursorConfig (LCDIF_Type *base, const lcdif_cursor_config_t *config) |
| Configure the cursor. More... | |
| static void | LCDIF_SetCursorHotspotPosition (LCDIF_Type *base, uint16_t x, uint16_t y) |
| Set the cursor hotspot postion. More... | |
| static void | LCDIF_SetCursorBufferAddress (LCDIF_Type *base, uint32_t address) |
| Set the cursor memory address. More... | |
| void | LCDIF_SetCursorColor (LCDIF_Type *base, uint32_t background, uint32_t foreground) |
| Set the cursor color. More... | |
| struct lcdif_dpi_config_t |
Data Fields | |
| uint16_t | panelWidth |
| Display panel width, pixels per line. More... | |
| uint16_t | panelHeight |
| Display panel height, how many lines per panel. More... | |
| uint8_t | hsw |
| HSYNC pulse width. More... | |
| uint8_t | hfp |
| Horizontal front porch. More... | |
| uint8_t | hbp |
| Horizontal back porch. More... | |
| uint8_t | vsw |
| VSYNC pulse width. More... | |
| uint8_t | vfp |
| Vrtical front porch. More... | |
| uint8_t | vbp |
| Vertical back porch. More... | |
| uint32_t | polarityFlags |
| OR'ed value of _lcdif_polarity_flags, used to contol the signal polarity. More... | |
| lcdif_output_format_t | format |
| DPI output format. More... | |
| uint16_t lcdif_dpi_config_t::panelWidth |
| uint16_t lcdif_dpi_config_t::panelHeight |
| uint8_t lcdif_dpi_config_t::hsw |
| uint8_t lcdif_dpi_config_t::hfp |
| uint8_t lcdif_dpi_config_t::hbp |
| uint8_t lcdif_dpi_config_t::vsw |
| uint8_t lcdif_dpi_config_t::vfp |
| uint8_t lcdif_dpi_config_t::vbp |
| uint32_t lcdif_dpi_config_t::polarityFlags |
| lcdif_output_format_t lcdif_dpi_config_t::format |
| struct lcdif_fb_config_t |
Data Fields | |
| bool | enable |
| Enable the frame buffer output. More... | |
| bool | enableGamma |
| Enable the gamma correction. More... | |
| lcdif_fb_format_t | format |
| Frame buffer pixel format. More... | |
| bool lcdif_fb_config_t::enable |
| bool lcdif_fb_config_t::enableGamma |
| lcdif_fb_format_t lcdif_fb_config_t::format |
| struct lcdif_cursor_config_t |
Data Fields | |
| bool | enable |
| Enable the cursor or not. More... | |
| lcdif_cursor_format_t | format |
| Cursor format. More... | |
| uint8_t | hotspotOffsetX |
| Offset of the hotspot to top left point, range 0 ~ 31. | |
| uint8_t | hotspotOffsetY |
| Offset of the hotspot to top left point, range 0 ~ 31. | |
| bool lcdif_cursor_config_t::enable |
| lcdif_cursor_format_t lcdif_cursor_config_t::format |
| struct lcdif_dither_config_t |
Data Fields | |
| bool | enable |
| Enable or not. More... | |
| uint8_t | redSize |
| Red color size, valid region 4-8. More... | |
| uint8_t | greenSize |
| Green color size, valid region 4-8. More... | |
| uint8_t | blueSize |
| Blue color size, valid region 4-8. More... | |
| uint32_t | low |
| Low part of the look up table. More... | |
| uint32_t | high |
| High part of the look up table. More... | |
| bool lcdif_dither_config_t::enable |
| uint8_t lcdif_dither_config_t::redSize |
| uint8_t lcdif_dither_config_t::greenSize |
| uint8_t lcdif_dither_config_t::blueSize |
| uint32_t lcdif_dither_config_t::low |
| uint32_t lcdif_dither_config_t::high |
| struct lcdif_dbi_config_t |
Data Fields | |
| lcdif_dbi_out_swizzle_t | swizzle |
| Swizzle. More... | |
| lcdif_dbi_out_format_t | format |
| Output format. More... | |
| uint8_t | acTimeUnit |
| Time unit for AC characteristics. More... | |
| lcdif_dbi_type_t | type |
| DBI type. More... | |
| uint16_t | writeWRPeriod |
| WR signal period, Cycle number = writeWRPeriod * (acTimeUnit + 1), must be no less than 3. More... | |
| uint8_t | writeWRAssert |
| Cycle number = writeWRAssert * (acTimeUnit + 1), only for type A and type B. More... | |
| uint8_t | writeCSAssert |
| Cycle number = writeCSAssert * (acTimeUnit + 1), only for type A and type B. More... | |
| uint16_t | writeWRDeassert |
| Cycle number = writeWRDeassert * (acTimeUnit + 1), only for type A and type B. More... | |
| uint16_t | writeCSDeassert |
| Cycle number = writeCSDeassert * (acTimeUnit + 1), only for type A and type B. More... | |
| lcdif_dbi_out_swizzle_t lcdif_dbi_config_t::swizzle |
| lcdif_dbi_out_format_t lcdif_dbi_config_t::format |
| uint8_t lcdif_dbi_config_t::acTimeUnit |
| lcdif_dbi_type_t lcdif_dbi_config_t::type |
| uint16_t lcdif_dbi_config_t::writeWRPeriod |
Only for type A and type b.
| uint8_t lcdif_dbi_config_t::writeWRAssert |
With kLCDIF_DbiTypeA_FixedE: Not used. With kLCDIF_DbiTypeA_ClockedE: Time to assert E. With kLCDIF_DbiTypeB: Time to assert WRX.
| uint8_t lcdif_dbi_config_t::writeCSAssert |
With kLCDIF_DbiTypeA_FixedE: Time to assert CSX. With kLCDIF_DbiTypeA_ClockedE: Not used. With kLCDIF_DbiTypeB: Time to assert CSX.
| uint16_t lcdif_dbi_config_t::writeWRDeassert |
With kLCDIF_DbiTypeA_FixedE: Not used. With kLCDIF_DbiTypeA_ClockedE: Time to de-assert E. With kLCDIF_DbiTypeB: Time to de-assert WRX.
| uint16_t lcdif_dbi_config_t::writeCSDeassert |
With kLCDIF_DbiTypeA_FixedE: Time to de-assert CSX. With kLCDIF_DbiTypeA_ClockedE: Not used. With kLCDIF_DbiTypeB: Time to de-assert CSX.
| #define LCDIF_MAKE_CURSOR_COLOR | ( | r, | |
| g, | |||
| b | |||
| ) | (((r) << 16U) | ((g) << 8U) | ((b) << 0U)) |
| #define LCDIF_MAKE_GAMMA_VALUE | ( | r, | |
| g, | |||
| b | |||
| ) | (((r) << 16U) | ((g) << 8U) | ((b) << 0U)) |
| #define LCDIF_ALIGN_ADDR | ( | addr, | |
| align | |||
| ) | (((addr) + (align)-1U) & ~((align)-1U)) |
| #define LCDIF_FB_ALIGN 128U |
| #define LCDIF_GAMMA_INDEX_MAX 256U |
| enum lcdif_fb_format_t |
| enum _lcdif_interrupt |
| enum _lcdif_dbi_cmd_flag |
| enum lcdif_dbi_type_t |
| status_t LCDIF_Init | ( | LCDIF_Type * | base | ) |
This function initializes the LCDIF to work.
| base | LCDIF peripheral base address. |
| kStatus_Success | Initialize successfully. |
| void LCDIF_Deinit | ( | LCDIF_Type * | base | ) |
This function disables the LCDIF peripheral clock.
| base | LCDIF peripheral base address. |
| void LCDIF_DpiModeGetDefaultConfig | ( | lcdif_dpi_config_t * | config | ) |
The default configuration value is:
| config | Pointer to the LCDIF configuration. |
| status_t LCDIF_DpiModeSetConfig | ( | LCDIF_Type * | base, |
| uint8_t | displayIndex, | ||
| const lcdif_dpi_config_t * | config | ||
| ) |
This function configures the LCDIF DPI display.
| base | LCDIF peripheral base address. |
| displayIndex | Display index. |
| config | Pointer to the configuration structure. |
| kStatus_Success | Initialize successfully. |
| kStatus_InvalidArgument | Initialize failed because of invalid argument. |
| status_t LCDIF_DbiModeSetConfig | ( | LCDIF_Type * | base, |
| uint8_t | displayIndex, | ||
| const lcdif_dbi_config_t * | config | ||
| ) |
This function configures the LCDIF DBI display.
| base | LCDIF peripheral base address. |
| displayIndex | Display index. |
| config | Pointer to the configuration structure. |
| kStatus_Success | Initialize successfully. |
| kStatus_InvalidArgument | Initialize failed because of invalid argument. |
| void LCDIF_DbiModeGetDefaultConfig | ( | lcdif_dbi_config_t * | config | ) |
The default configuration value is:
| config | Pointer to the LCDIF DBI configuration. |
|
inlinestatic |
| displayIndex | Display index. |
| base | LCDIF peripheral base address. |
| void LCDIF_DbiSelectArea | ( | LCDIF_Type * | base, |
| uint8_t | displayIndex, | ||
| uint16_t | startX, | ||
| uint16_t | startY, | ||
| uint16_t | endX, | ||
| uint16_t | endY, | ||
| bool | isTiled | ||
| ) |
| base | LCDIF peripheral base address. |
| displayIndex | Display index. |
| startX | X coordinate for start pixel. |
| startY | Y coordinate for start pixel. |
| endX | X coordinate for end pixel. |
| endY | Y coordinate for end pixel. |
| isTiled | true if the pixel data is tiled. |
|
inlinestatic |
| base | LCDIF peripheral base address. |
| displayIndex | Display index. |
| cmd | the DBI command to send. |
| void LCDIF_DbiSendData | ( | LCDIF_Type * | base, |
| uint8_t | displayIndex, | ||
| const uint8_t * | data, | ||
| uint32_t | dataLen_Byte | ||
| ) |
Can be used to send light weight data to panel. To send pixel data in frame buffer, use LCDIF_DbiWriteMem.
param base LCDIF peripheral base address. param displayIndex Display index. param data pointer to data buffer. param dataLen_Byte data buffer length in byte.
| void LCDIF_DbiSendCommandAndData | ( | LCDIF_Type * | base, |
| uint8_t | displayIndex, | ||
| uint8_t | cmd, | ||
| const uint8_t * | data, | ||
| uint32_t | dataLen_Byte | ||
| ) |
| base | LCDIF peripheral base address. |
| displayIndex | Display index. |
| cmd | the DBI command to send. |
| data | pointer to data buffer. |
| dataLen_Byte | data buffer length in byte. |
|
inlinestatic |
This function starts sending the pixel data in frame buffer to panel controller, user can monitor interrupt kLCDIF_Display0FrameDoneInterrupt to know when then data sending finished.
| base | LCDIF peripheral base address. |
| displayIndex | Display index. |
| void LCDIF_SetFrameBufferConfig | ( | LCDIF_Type * | base, |
| uint8_t | displayIndex, | ||
| const lcdif_fb_config_t * | config | ||
| ) |
: For LCDIF of version DC8000 there can be 3 layers in the pre-processing, compared with the older version. Apart from the video layer, there are also 2 overlay layers which shares the same configurations. Use this API to configure the legacy video layer, and use LCDIF_SetOverlayFrameBufferConfig to configure the overlay layers.
| base | LCDIF peripheral base address. |
| displayIndex | Display index. |
| config | Pointer to the configuration structure. |
| void LCDIF_FrameBufferGetDefaultConfig | ( | lcdif_fb_config_t * | config | ) |
: For LCDIF of version DC8000 there can be 3 layers in the pre-processing, compared with the older version. Apart from the video layer, there are also 2 overlay layers which shares the same configurations. Use this API to get the default configuration for all the 3 layers.
The default configuration is
| config | Pointer to the configuration structure. |
|
inlinestatic |
| base | LCDIF peripheral base address. |
| displayIndex | Display index. |
| address | Frame buffer address. |
| void LCDIF_SetFrameBufferStride | ( | LCDIF_Type * | base, |
| uint8_t | displayIndex, | ||
| uint32_t | strideBytes | ||
| ) |
| base | LCDIF peripheral base address. |
| displayIndex | Display index. |
| strideBytes | The stride in byte. |
| void LCDIF_SetDitherConfig | ( | LCDIF_Type * | base, |
| uint8_t | displayIndex, | ||
| const lcdif_dither_config_t * | config | ||
| ) |
| base | LCDIF peripheral base address. |
| displayIndex | Index to configure. |
| config | Pointer to the configuration structure. |
| void LCDIF_SetGammaData | ( | LCDIF_Type * | base, |
| uint8_t | displayIndex, | ||
| uint16_t | startIndex, | ||
| const uint32_t * | gamma, | ||
| uint16_t | gammaLen | ||
| ) |
| base | LCDIF peripheral base address. |
| displayIndex | Display index. |
| startIndex | Start index in the gamma table that the value will be set to. |
| gamma | The gamma values to set to the gamma table in LCDIF, could be defined using LCDIF_MAKE_GAMMA_VALUE. |
| gammaLen | The length of the gamma. |
|
inlinestatic |
| base | LCDIF peripheral base address. |
| mask | The interrupts to enable, pass in as OR'ed value of _lcdif_interrupt. |
|
inlinestatic |
| base | LCDIF peripheral base address. |
| mask | The interrupts to disable, pass in as OR'ed value of _lcdif_interrupt. |
|
inlinestatic |
| base | LCDIF peripheral base address. |
| void LCDIF_CursorGetDefaultConfig | ( | lcdif_cursor_config_t * | config | ) |
The default configuration values are:
| config | Pointer to the hardware cursor configuration structure. |
| void LCDIF_SetCursorConfig | ( | LCDIF_Type * | base, |
| const lcdif_cursor_config_t * | config | ||
| ) |
| base | LCDIF peripheral base address. |
| config | Cursor configuration. |
|
inlinestatic |
| base | LCDIF peripheral base address. |
| x | X coordinate of the hotspot, range 0 ~ 8191. |
| y | Y coordinate of the hotspot, range 0 ~ 8191. |
|
inlinestatic |
| base | LCDIF peripheral base address. |
| address | Memory address. |
| void LCDIF_SetCursorColor | ( | LCDIF_Type * | base, |
| uint32_t | background, | ||
| uint32_t | foreground | ||
| ) |
| base | LCDIF peripheral base address. |
| background | Background color, could be defined use LCDIF_MAKE_CURSOR_COLOR |
| foreground | Foreground color, could be defined use LCDIF_MAKE_CURSOR_COLOR |