![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
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... | |
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_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. | |
| #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_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. | |
Functions | |
| 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... | |
Driver version | |
| #define | FSL_LCDIF_DRIVER_VERSION (MAKE_VERSION(2, 0, 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... | |
Frame buffer | |
| void | LCDIF_SetFrameBufferConfig (LCDIF_Type *base, uint8_t fbIndex, 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 fbIndex, uint32_t address) |
| Set the frame buffer to LCDIF. More... | |
| void | LCDIF_SetFrameBufferStride (LCDIF_Type *base, uint8_t fbIndex, 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 fbIndex, 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... | |
Driver version | |
| #define | FSL_LCDIF_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
| 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 |
| #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_FB_ALIGN 128U |
| #define LCDIF_GAMMA_INDEX_MAX 256U |
| #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_FB_ALIGN 128U |
| #define LCDIF_GAMMA_INDEX_MAX 256U |
| enum lcdif_fb_format_t |
| enum _lcdif_interrupt |
| enum lcdif_fb_format_t |
| enum _lcdif_interrupt |
| 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. |
| void LCDIF_SetFrameBufferConfig | ( | LCDIF_Type * | base, |
| uint8_t | fbIndex, | ||
| const lcdif_fb_config_t * | config | ||
| ) |
| base | LCDIF peripheral base address. |
| fbIndex | Frame buffer index. |
| config | Pointer to the configuration structure. |
| void LCDIF_FrameBufferGetDefaultConfig | ( | lcdif_fb_config_t * | config | ) |
The default configuration is config->enable = true; config->enableGamma = false; config->format = kLCDIF_PixelFormatRGB565;
| config | Pointer to the configuration structure. |
|
inlinestatic |
| base | LCDIF peripheral base address. |
| fbIndex | Frame buffer index. |
| address | Frame buffer address. |
| void LCDIF_SetFrameBufferStride | ( | LCDIF_Type * | base, |
| uint8_t | fbIndex, | ||
| uint32_t | strideBytes | ||
| ) |
| base | LCDIF peripheral base address. |
| fbIndex | Frame buffer 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 | fbIndex, | ||
| uint16_t | startIndex, | ||
| const uint32_t * | gamma, | ||
| uint16_t | gammaLen | ||
| ) |
| base | LCDIF peripheral base address. |
| fbIndex | The frame buffer 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. |
| x | X coordinate of the hotspot, range 0 ~ 8191. |
| y | Y coordinate of the hotspot, range 0 ~ 8191. |
|
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 |