10#define _FSL_LCDIFV2_H_
12#include "fsl_common.h"
14#if (defined(FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET) && (0 != FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET))
15#include "fsl_memory.h"
30#define FSL_LCDIFV2_DRIVER_VERSION (MAKE_VERSION(2, 3, 2))
33#if defined(FSL_FEATURE_LCDIFV2_LAYER_COUNT) && (!defined(LCDIFV2_LAYER_COUNT))
34#define LCDIFV2_LAYER_COUNT FSL_FEATURE_LCDIFV2_LAYER_COUNT
37#if defined(FSL_FEATURE_LCDIFV2_LAYER_CSC_COUNT) && (!defined(LCDIFV2_LAYER_CSC_COUNT))
38#define LCDIFV2_LAYER_CSC_COUNT FSL_FEATURE_LCDIFV2_LAYER_CSC_COUNT
41#if (defined(FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET) && (0 != FSL_FEATURE_MEMORY_HAS_ADDRESS_OFFSET))
42#define LCDIFV2_ADDR_CPU_2_IP(addr) (MEMORY_ConvertMemoryMapAddress((uint32_t)(addr), kMEMORY_Local2DMA))
44#define LCDIFV2_ADDR_CPU_2_IP(addr) (addr)
48#define LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(layer) (1UL << ((uint32_t)(layer) + 24U))
50#define LCDIFV2_MAKE_DMA_DONE_INTERRUPT(layer) (1UL << ((uint32_t)(layer) + 16U))
52#define LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(layer) (1UL << ((uint32_t)(layer) + 8U))
55#define LCDIFV2_LUT_ENTRY_NUM 256U
276#if defined(__cplusplus)
352static inline void LCDIFV2_EnableDisplay(
LCDIFV2_Type *base,
bool enable)
356 base->DISP_PARA |= LCDIFV2_DISP_PARA_DISP_ON_MASK;
360 base->DISP_PARA &= ~LCDIFV2_DISP_PARA_DISP_ON_MASK;
378static inline void LCDIFV2_EnableInterrupts(
LCDIFV2_Type *base, uint8_t domain, uint32_t mask)
380 base->INT[domain].INT_ENABLE |= mask;
390static inline void LCDIFV2_DisableInterrupts(
LCDIFV2_Type *base, uint8_t domain, uint32_t mask)
392 base->INT[domain].INT_ENABLE &= ~mask;
402static inline uint32_t LCDIFV2_GetInterruptStatus(
LCDIFV2_Type *base, uint8_t domain)
404 return base->INT[domain].INT_STATUS;
414static inline void LCDIFV2_ClearInterruptStatus(
LCDIFV2_Type *base, uint8_t domain, uint32_t mask)
416 base->INT[domain].INT_STATUS = mask;
443 LCDIFV2_Type *base, uint8_t layerIndex,
const uint32_t *lutData, uint16_t count,
bool useShadowLoad);
462static inline void LCDIFV2_SetLayerSize(
LCDIFV2_Type *base, uint8_t layerIndex, uint16_t width, uint16_t height)
464 base->LAYER[layerIndex].CTRLDESCL1 =
465 ((uint32_t)height << LCDIFV2_CTRLDESCL1_HEIGHT_SHIFT) | ((uint32_t)width << LCDIFV2_CTRLDESCL1_WIDTH_SHIFT);
476static inline void LCDIFV2_SetLayerOffset(
LCDIFV2_Type *base, uint8_t layerIndex, uint16_t offsetX, uint16_t offsetY)
478 base->LAYER[layerIndex].CTRLDESCL2 =
479 ((uint32_t)offsetX << LCDIFV2_CTRLDESCL2_POSX_SHIFT) | ((uint32_t)offsetY << LCDIFV2_CTRLDESCL2_POSY_SHIFT);
500static inline void LCDIFV2_SetLayerBufferAddr(
LCDIFV2_Type *base, uint8_t layerIndex, uint32_t addr)
502 base->LAYER[layerIndex].CTRLDESCL4 = LCDIFV2_ADDR_CPU_2_IP(addr);
512static inline void LCDIFV2_EnableLayer(
LCDIFV2_Type *base, uint8_t layerIndex,
bool enable)
516 base->LAYER[layerIndex].CTRLDESCL5 |= LCDIFV2_CTRLDESCL5_EN_MASK;
520 base->LAYER[layerIndex].CTRLDESCL5 &= ~LCDIFV2_CTRLDESCL5_EN_MASK;
535static inline void LCDIFV2_TriggerLayerShadowLoad(
LCDIFV2_Type *base, uint8_t layerIndex)
537 base->LAYER[layerIndex].CTRLDESCL5 |= LCDIFV2_CTRLDESCL5_SHADOW_LOAD_EN_MASK;
549static inline void LCDIFV2_SetLayerBackGroundColor(
LCDIFV2_Type *base, uint8_t layerIndex, uint32_t backGroundColor)
551 base->LAYER[layerIndex].CTRLDESCL6 = backGroundColor;
649#if defined(__cplusplus)
#define LCDIFV2_CTRLDESCL5_YUV_FORMAT(x)
Definition: MIMXRT1166_cm4.h:58353
#define LCDIFV2_CTRLDESCL5_BPP(x)
Definition: MIMXRT1166_cm4.h:58376
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
lcdifv2_pd_factor_mode_t pdFactorMode
Definition: fsl_lcdifv2.h:242
lcdifv2_alpha_mode_t alphaMode
Definition: fsl_lcdifv2.h:235
_lcdifv2_interrupt
The LCDIF v2 interrupts.
Definition: fsl_lcdifv2.h:81
uint32_t polarityFlags
Definition: fsl_lcdifv2.h:135
void LCDIFV2_Deinit(LCDIFV2_Type *base)
Deinitializes the LCDIF peripheral.
Definition: fsl_lcdifv2.c:134
enum _lcdifv2_alpha_mode lcdifv2_alpha_mode_t
LCDIF v2 layer alpha blending mode.
void LCDIFV2_Reset(LCDIFV2_Type *base)
Reset the LCDIF v2.
Definition: fsl_lcdifv2.c:150
uint16_t strideBytes
Definition: fsl_lcdifv2.h:173
void LCDIFV2_SetCscMode(LCDIFV2_Type *base, uint8_t layerIndex, lcdifv2_csc_mode_t mode)
Set the color space conversion mode.
Definition: fsl_lcdifv2.c:217
void LCDIFV2_Init(LCDIFV2_Type *base)
Initializes the LCDIF v2.
Definition: fsl_lcdifv2.c:115
enum _lcdifv2_line_order lcdifv2_line_order_t
The LCDIF v2 output line order.
uint8_t vfp
Definition: fsl_lcdifv2.h:133
status_t LCDIFV2_SetLut(LCDIFV2_Type *base, uint8_t layerIndex, const uint32_t *lutData, uint16_t count, bool useShadowLoad)
Set the LUT data.
Definition: fsl_lcdifv2.c:299
lcdifv2_line_order_t lineOrder
Definition: fsl_lcdifv2.h:136
enum _lcdifv2_pd_blend_mode lcdifv2_pd_blend_mode_t
LCDIFv2 Porter Duff blend mode. Note: Don't change the enum item value.
_lcdifv2_alpha_mode
LCDIF v2 layer alpha blending mode.
Definition: fsl_lcdifv2.h:181
_lcdifv2_line_order
The LCDIF v2 output line order.
Definition: fsl_lcdifv2.h:113
uint8_t hbp
Definition: fsl_lcdifv2.h:131
_lcdifv2_pd_alpha_mode
LCDIF v2 PoterDuff alpha mode.
Definition: fsl_lcdifv2.h:192
_lcdifv2_pd_layer
LCDIFv2 Porter Duff layer. Note: Don't change the enum item value.
Definition: fsl_lcdifv2.h:266
#define LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(layer)
LCDIF v2 FIFO empty interrupt.
Definition: fsl_lcdifv2.h:48
struct _lcdifv2_buffer_config lcdifv2_buffer_config_t
LCDIF v2 source buffer configuration.
void LCDIFV2_SetLayerBufferConfig(LCDIFV2_Type *base, uint8_t layerIndex, const lcdifv2_buffer_config_t *config)
Set the layer source buffer configuration.
Definition: fsl_lcdifv2.c:266
enum _lcdifv2_pd_layer lcdifv2_pd_layer_t
LCDIFv2 Porter Duff layer. Note: Don't change the enum item value.
struct _lcdifv2_display_config lcdifv2_display_config_t
LCDIF v2 display configure structure.
lcdifv2_pixel_format_t pixelFormat
Definition: fsl_lcdifv2.h:174
enum _lcdifv2_pixel_format lcdifv2_pixel_format_t
LCDIF v2 pixel format.
_lcdifv2_pixel_format
LCDIF v2 pixel format.
Definition: fsl_lcdifv2.h:149
_lcdifv2_polarity_flags
LCDIF v2 signal polarity flags.
Definition: fsl_lcdifv2.h:61
_lcdifv2_pd_color_mode
LCDIF v2 PoterDuff color mode.
Definition: fsl_lcdifv2.h:201
uint8_t hsw
Definition: fsl_lcdifv2.h:129
uint16_t panelHeight
Definition: fsl_lcdifv2.h:128
lcdifv2_pd_global_alpha_mode_t pdGlobalAlphaMode
Definition: fsl_lcdifv2.h:240
lcdifv2_pd_alpha_mode_t pdAlphaMode
Definition: fsl_lcdifv2.h:236
_lcdifv2_csc_mode
LCDIF v2 color space conversion mode.
Definition: fsl_lcdifv2.h:141
uint16_t panelWidth
Definition: fsl_lcdifv2.h:127
#define LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(layer)
LCDIF v2 DMA error interrupt.
Definition: fsl_lcdifv2.h:52
enum _lcdifv2_pd_global_alpha_mode lcdifv2_pd_global_alpha_mode_t
LCDIF v2 PoterDuff global alpha mode.
status_t LCDIFV2_GetPorterDuffConfig(lcdifv2_pd_blend_mode_t mode, lcdifv2_pd_layer_t layer, lcdifv2_blend_config_t *config)
Get the blend configuration for Porter Duff blend.
Definition: fsl_lcdifv2.c:379
#define LCDIFV2_MAKE_DMA_DONE_INTERRUPT(layer)
LCDIF v2 DMA done interrupt.
Definition: fsl_lcdifv2.h:50
enum _lcdifv2_pd_factor_mode lcdifv2_pd_factor_mode_t
LCDIF v2 PoterDuff factor mode.
enum _lcdifv2_csc_mode lcdifv2_csc_mode_t
LCDIF v2 color space conversion mode.
_lcdifv2_pd_global_alpha_mode
LCDIF v2 PoterDuff global alpha mode.
Definition: fsl_lcdifv2.h:210
void LCDIFV2_DisplayGetDefaultConfig(lcdifv2_display_config_t *config)
Gets the LCDIF display default configuration structure.
Definition: fsl_lcdifv2.c:163
_lcdifv2_pd_factor_mode
LCDIF v2 PoterDuff factor mode.
Definition: fsl_lcdifv2.h:220
uint8_t hfp
Definition: fsl_lcdifv2.h:130
void LCDIFV2_SetDisplayConfig(LCDIFV2_Type *base, const lcdifv2_display_config_t *config)
Set the LCDIF v2 display configurations.
Definition: fsl_lcdifv2.c:187
uint8_t vbp
Definition: fsl_lcdifv2.h:134
void LCDIFV2_SetLayerBlendConfig(LCDIFV2_Type *base, uint8_t layerIndex, const lcdifv2_blend_config_t *config)
Set the layer alpha blend mode.
Definition: fsl_lcdifv2.c:341
enum _lcdifv2_pd_color_mode lcdifv2_pd_color_mode_t
LCDIF v2 PoterDuff color mode.
uint8_t globalAlpha
Definition: fsl_lcdifv2.h:232
enum _lcdifv2_pd_alpha_mode lcdifv2_pd_alpha_mode_t
LCDIF v2 PoterDuff alpha mode.
lcdifv2_pd_color_mode_t pdColorMode
Definition: fsl_lcdifv2.h:238
struct _lcdifv2_blend_config lcdifv2_blend_config_t
LCDIF v2 layer alpha blending configuration.
_lcdifv2_pd_blend_mode
LCDIFv2 Porter Duff blend mode. Note: Don't change the enum item value.
Definition: fsl_lcdifv2.h:248
uint8_t vsw
Definition: fsl_lcdifv2.h:132
status_t LCDIFV2_GetMultiLayerGlobalAlpha(const uint8_t blendedAlpha[], uint8_t globalAlpha[], uint8_t layerCount)
Get the global alpha values for multiple layer blend.
Definition: fsl_lcdifv2.c:477
@ kLCDIFV2_Layer7DmaDoneInterrupt
Definition: fsl_lcdifv2.h:97
@ kLCDIFV2_Layer3DmaDoneInterrupt
Definition: fsl_lcdifv2.h:93
@ kLCDIFV2_Layer3DmaErrorInterrupt
Definition: fsl_lcdifv2.h:101
@ kLCDIFV2_Layer5DmaErrorInterrupt
Definition: fsl_lcdifv2.h:103
@ kLCDIFV2_Layer2DmaDoneInterrupt
Definition: fsl_lcdifv2.h:92
@ kLCDIFV2_Layer0FifoEmptyInterrupt
Definition: fsl_lcdifv2.h:82
@ kLCDIFV2_Layer6DmaErrorInterrupt
Definition: fsl_lcdifv2.h:104
@ kLCDIFV2_Layer2DmaErrorInterrupt
Definition: fsl_lcdifv2.h:100
@ kLCDIFV2_Layer0DmaDoneInterrupt
Definition: fsl_lcdifv2.h:90
@ kLCDIFV2_Layer0DmaErrorInterrupt
Definition: fsl_lcdifv2.h:98
@ kLCDIFV2_Layer3FifoEmptyInterrupt
Definition: fsl_lcdifv2.h:85
@ kLCDIFV2_VerticalBlankingInterrupt
Definition: fsl_lcdifv2.h:106
@ kLCDIFV2_Layer1DmaErrorInterrupt
Definition: fsl_lcdifv2.h:99
@ kLCDIFV2_VsyncEdgeInterrupt
Definition: fsl_lcdifv2.h:108
@ kLCDIFV2_Layer7FifoEmptyInterrupt
Definition: fsl_lcdifv2.h:89
@ kLCDIFV2_Layer4DmaErrorInterrupt
Definition: fsl_lcdifv2.h:102
@ kLCDIFV2_Layer4DmaDoneInterrupt
Definition: fsl_lcdifv2.h:94
@ kLCDIFV2_Layer6FifoEmptyInterrupt
Definition: fsl_lcdifv2.h:88
@ kLCDIFV2_Layer2FifoEmptyInterrupt
Definition: fsl_lcdifv2.h:84
@ kLCDIFV2_Layer1FifoEmptyInterrupt
Definition: fsl_lcdifv2.h:83
@ kLCDIFV2_Layer6DmaDoneInterrupt
Definition: fsl_lcdifv2.h:96
@ kLCDIFV2_Layer7DmaErrorInterrupt
Definition: fsl_lcdifv2.h:105
@ kLCDIFV2_Layer5FifoEmptyInterrupt
Definition: fsl_lcdifv2.h:87
@ kLCDIFV2_Layer1DmaDoneInterrupt
Definition: fsl_lcdifv2.h:91
@ kLCDIFV2_Layer5DmaDoneInterrupt
Definition: fsl_lcdifv2.h:95
@ kLCDIFV2_OutputUnderrunInterrupt
Definition: fsl_lcdifv2.h:107
@ kLCDIFV2_Layer4FifoEmptyInterrupt
Definition: fsl_lcdifv2.h:86
@ kLCDIFV2_AlphaEmbedded
Definition: fsl_lcdifv2.h:184
@ kLCDIFV2_AlphaDisable
Definition: fsl_lcdifv2.h:182
@ kLCDIFV2_AlphaOverride
Definition: fsl_lcdifv2.h:183
@ kLCDIFV2_AlphaPoterDuff
Definition: fsl_lcdifv2.h:185
@ kLCDIFV2_LineOrderGBR
Definition: fsl_lcdifv2.h:116
@ kLCDIFV2_LineOrderBGR
Definition: fsl_lcdifv2.h:119
@ kLCDIFV2_LineOrderGRB
Definition: fsl_lcdifv2.h:117
@ kLCDIFV2_LineOrderRBG
Definition: fsl_lcdifv2.h:115
@ kLCDIFV2_LineOrderBRG
Definition: fsl_lcdifv2.h:118
@ kLCDIFV2_LineOrderRGB
Definition: fsl_lcdifv2.h:114
@ kLCDIFV2_PD_AlphaStraight
Definition: fsl_lcdifv2.h:193
@ kLCDIFV2_PD_AlphaInversed
Definition: fsl_lcdifv2.h:194
@ kLCDIFV2_PD_LayerMax
Definition: fsl_lcdifv2.h:269
@ kLCDIFV2_PD_DestLayer
Definition: fsl_lcdifv2.h:268
@ kLCDIFV2_PD_SrcLayer
Definition: fsl_lcdifv2.h:267
@ kLCDIFV2_PixelFormatYUYV
Definition: fsl_lcdifv2.h:161
@ kLCDIFV2_PixelFormatARGB4444
Definition: fsl_lcdifv2.h:156
@ kLCDIFV2_PixelFormatRGB888
Definition: fsl_lcdifv2.h:165
@ kLCDIFV2_PixelFormatABGR8888
Definition: fsl_lcdifv2.h:167
@ kLCDIFV2_PixelFormatARGB8888
Definition: fsl_lcdifv2.h:166
@ kLCDIFV2_PixelFormatVYUY
Definition: fsl_lcdifv2.h:159
@ kLCDIFV2_PixelFormatUYVY
Definition: fsl_lcdifv2.h:157
@ kLCDIFV2_PixelFormatIndex8BPP
Definition: fsl_lcdifv2.h:153
@ kLCDIFV2_PixelFormatYVYU
Definition: fsl_lcdifv2.h:163
@ kLCDIFV2_PixelFormatIndex2BPP
Definition: fsl_lcdifv2.h:151
@ kLCDIFV2_PixelFormatRGB565
Definition: fsl_lcdifv2.h:154
@ kLCDIFV2_PixelFormatIndex4BPP
Definition: fsl_lcdifv2.h:152
@ kLCDIFV2_PixelFormatARGB1555
Definition: fsl_lcdifv2.h:155
@ kLCDIFV2_PixelFormatIndex1BPP
Definition: fsl_lcdifv2.h:150
@ kLCDIFV2_HsyncActiveLow
Definition: fsl_lcdifv2.h:70
@ kLCDIFV2_DriveDataOnFallingClkEdge
Definition: fsl_lcdifv2.h:72
@ kLCDIFV2_DataActiveHigh
Definition: fsl_lcdifv2.h:67
@ kLCDIFV2_DataActiveLow
Definition: fsl_lcdifv2.h:74
@ kLCDIFV2_HsyncActiveHigh
Definition: fsl_lcdifv2.h:63
@ kLCDIFV2_VsyncActiveLow
Definition: fsl_lcdifv2.h:69
@ kLCDIFV2_DriveDataOnRisingClkEdge
Definition: fsl_lcdifv2.h:65
@ kLCDIFV2_DataEnableActiveLow
Definition: fsl_lcdifv2.h:71
@ kLCDIFV2_DataEnableActiveHigh
Definition: fsl_lcdifv2.h:64
@ kLCDIFV2_VsyncActiveHigh
Definition: fsl_lcdifv2.h:62
@ kLCDIFV2_PD_ColorNoAlpha
Definition: fsl_lcdifv2.h:202
@ kLCDIFV2_PD_ColorWithAlpha
Definition: fsl_lcdifv2.h:203
@ kLCDIFV2_CscDisable
Definition: fsl_lcdifv2.h:142
@ kLCDIFV2_CscYCbCr2RGB
Definition: fsl_lcdifv2.h:144
@ kLCDIFV2_CscYUV2RGB
Definition: fsl_lcdifv2.h:143
@ kLCDIFV2_PD_LocalAlpha
Definition: fsl_lcdifv2.h:212
@ kLCDIFV2_PD_GlobalAlpha
Definition: fsl_lcdifv2.h:211
@ kLCDIFV2_PD_ScaledAlpha
Definition: fsl_lcdifv2.h:213
@ kLCDIFV2_PD_FactorInversedAlpha
Definition: fsl_lcdifv2.h:224
@ kLCDIFV2_PD_FactorZero
Definition: fsl_lcdifv2.h:222
@ kLCDIFV2_PD_FactorStraightAlpha
Definition: fsl_lcdifv2.h:223
@ kLCDIFV2_PD_FactorOne
Definition: fsl_lcdifv2.h:221
@ kLCDIFV2_PD_Clear
Definition: fsl_lcdifv2.h:260
@ kLCDIFV2_PD_Out
Definition: fsl_lcdifv2.h:253
@ kLCDIFV2_PD_Max
Definition: fsl_lcdifv2.h:261
@ kLCDIFV2_PD_Xor
Definition: fsl_lcdifv2.h:259
@ kLCDIFV2_PD_DstOver
Definition: fsl_lcdifv2.h:256
@ kLCDIFV2_PD_DstIn
Definition: fsl_lcdifv2.h:257
@ kLCDIFV2_PD_Src
Definition: fsl_lcdifv2.h:249
@ kLCDIFV2_PD_Atop
Definition: fsl_lcdifv2.h:250
@ kLCDIFV2_PD_DstOut
Definition: fsl_lcdifv2.h:258
@ kLCDIFV2_PD_In
Definition: fsl_lcdifv2.h:252
@ kLCDIFV2_PD_Over
Definition: fsl_lcdifv2.h:251
@ kLCDIFV2_PD_DstAtop
Definition: fsl_lcdifv2.h:255
@ kLCDIFV2_PD_Dst
Definition: fsl_lcdifv2.h:254
Definition: MIMXRT1166_cm4.h:57742
LCDIF v2 layer alpha blending configuration.
Definition: fsl_lcdifv2.h:231
LCDIF v2 source buffer configuration.
Definition: fsl_lcdifv2.h:172
LCDIF v2 display configure structure.
Definition: fsl_lcdifv2.h:126
Definition: deflate.c:114