RTEMS 6.1-rc4
|
Data Structures | |
struct | _lcdifv2_display_config |
LCDIF v2 display configure structure. More... | |
struct | _lcdifv2_buffer_config |
LCDIF v2 source buffer configuration. More... | |
struct | _lcdifv2_blend_config |
LCDIF v2 layer alpha blending configuration. More... | |
Driver version | |
enum | _lcdifv2_polarity_flags { kLCDIFV2_VsyncActiveHigh = 0U , kLCDIFV2_HsyncActiveHigh = 0U , kLCDIFV2_DataEnableActiveHigh = 0U , kLCDIFV2_DriveDataOnRisingClkEdge = 0U , kLCDIFV2_DataActiveHigh = 0U , kLCDIFV2_VsyncActiveLow = LCDIFV2_CTRL_INV_VS_MASK , kLCDIFV2_HsyncActiveLow = LCDIFV2_CTRL_INV_HS_MASK , kLCDIFV2_DataEnableActiveLow = LCDIFV2_CTRL_INV_DE_MASK , kLCDIFV2_DriveDataOnFallingClkEdge = LCDIFV2_CTRL_INV_PXCK_MASK , kLCDIFV2_DataActiveLow = LCDIFV2_CTRL_NEG_MASK } |
LCDIF v2 signal polarity flags. More... | |
enum | _lcdifv2_interrupt { kLCDIFV2_Layer0FifoEmptyInterrupt = LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(0) , kLCDIFV2_Layer1FifoEmptyInterrupt = LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(1) , kLCDIFV2_Layer2FifoEmptyInterrupt = LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(2) , kLCDIFV2_Layer3FifoEmptyInterrupt = LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(3) , kLCDIFV2_Layer4FifoEmptyInterrupt = LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(4) , kLCDIFV2_Layer5FifoEmptyInterrupt = LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(5) , kLCDIFV2_Layer6FifoEmptyInterrupt = LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(6) , kLCDIFV2_Layer7FifoEmptyInterrupt = LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(7) , kLCDIFV2_Layer0DmaDoneInterrupt = LCDIFV2_MAKE_DMA_DONE_INTERRUPT(0) , kLCDIFV2_Layer1DmaDoneInterrupt = LCDIFV2_MAKE_DMA_DONE_INTERRUPT(1) , kLCDIFV2_Layer2DmaDoneInterrupt = LCDIFV2_MAKE_DMA_DONE_INTERRUPT(2) , kLCDIFV2_Layer3DmaDoneInterrupt = LCDIFV2_MAKE_DMA_DONE_INTERRUPT(3) , kLCDIFV2_Layer4DmaDoneInterrupt = LCDIFV2_MAKE_DMA_DONE_INTERRUPT(4) , kLCDIFV2_Layer5DmaDoneInterrupt = LCDIFV2_MAKE_DMA_DONE_INTERRUPT(5) , kLCDIFV2_Layer6DmaDoneInterrupt = LCDIFV2_MAKE_DMA_DONE_INTERRUPT(6) , kLCDIFV2_Layer7DmaDoneInterrupt = LCDIFV2_MAKE_DMA_DONE_INTERRUPT(7) , kLCDIFV2_Layer0DmaErrorInterrupt = LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(0) , kLCDIFV2_Layer1DmaErrorInterrupt = LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(1) , kLCDIFV2_Layer2DmaErrorInterrupt = LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(2) , kLCDIFV2_Layer3DmaErrorInterrupt = LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(3) , kLCDIFV2_Layer4DmaErrorInterrupt = LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(4) , kLCDIFV2_Layer5DmaErrorInterrupt = LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(5) , kLCDIFV2_Layer6DmaErrorInterrupt = LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(6) , kLCDIFV2_Layer7DmaErrorInterrupt = LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(7) , kLCDIFV2_VerticalBlankingInterrupt = (1U << 2U) , kLCDIFV2_OutputUnderrunInterrupt = (1U << 1U) , kLCDIFV2_VsyncEdgeInterrupt = (1U << 0U) } |
The LCDIF v2 interrupts. More... | |
enum | _lcdifv2_line_order { kLCDIFV2_LineOrderRGB = 0 , kLCDIFV2_LineOrderRBG , kLCDIFV2_LineOrderGBR , kLCDIFV2_LineOrderGRB , kLCDIFV2_LineOrderBRG , kLCDIFV2_LineOrderBGR } |
The LCDIF v2 output line order. More... | |
enum | _lcdifv2_csc_mode { kLCDIFV2_CscDisable = 0U , kLCDIFV2_CscYUV2RGB , kLCDIFV2_CscYCbCr2RGB } |
LCDIF v2 color space conversion mode. More... | |
enum | _lcdifv2_pixel_format { kLCDIFV2_PixelFormatIndex1BPP = LCDIFV2_CTRLDESCL5_BPP(0U) , kLCDIFV2_PixelFormatIndex2BPP = LCDIFV2_CTRLDESCL5_BPP(1U) , kLCDIFV2_PixelFormatIndex4BPP = LCDIFV2_CTRLDESCL5_BPP(2U) , kLCDIFV2_PixelFormatIndex8BPP = LCDIFV2_CTRLDESCL5_BPP(3U) , kLCDIFV2_PixelFormatRGB565 = LCDIFV2_CTRLDESCL5_BPP(4U) , kLCDIFV2_PixelFormatARGB1555 = LCDIFV2_CTRLDESCL5_BPP(5U) , kLCDIFV2_PixelFormatARGB4444 = LCDIFV2_CTRLDESCL5_BPP(6U) , kLCDIFV2_PixelFormatUYVY , kLCDIFV2_PixelFormatVYUY , kLCDIFV2_PixelFormatYUYV , kLCDIFV2_PixelFormatYVYU , kLCDIFV2_PixelFormatRGB888 = LCDIFV2_CTRLDESCL5_BPP(8U) , kLCDIFV2_PixelFormatARGB8888 = LCDIFV2_CTRLDESCL5_BPP(9U) , kLCDIFV2_PixelFormatABGR8888 = LCDIFV2_CTRLDESCL5_BPP(10U) } |
LCDIF v2 pixel format. More... | |
enum | _lcdifv2_alpha_mode { kLCDIFV2_AlphaDisable , kLCDIFV2_AlphaOverride , kLCDIFV2_AlphaEmbedded , kLCDIFV2_AlphaPoterDuff } |
LCDIF v2 layer alpha blending mode. More... | |
enum | _lcdifv2_pd_alpha_mode { kLCDIFV2_PD_AlphaStraight = 0 , kLCDIFV2_PD_AlphaInversed = 1 } |
LCDIF v2 PoterDuff alpha mode. More... | |
enum | _lcdifv2_pd_color_mode { kLCDIFV2_PD_ColorNoAlpha = 0 , kLCDIFV2_PD_ColorWithAlpha = 1 } |
LCDIF v2 PoterDuff color mode. More... | |
enum | _lcdifv2_pd_global_alpha_mode { kLCDIFV2_PD_GlobalAlpha = 0 , kLCDIFV2_PD_LocalAlpha = 1 , kLCDIFV2_PD_ScaledAlpha = 2 } |
LCDIF v2 PoterDuff global alpha mode. More... | |
enum | _lcdifv2_pd_factor_mode { kLCDIFV2_PD_FactorOne = 0 , kLCDIFV2_PD_FactorZero = 1 , kLCDIFV2_PD_FactorStraightAlpha = 2 , kLCDIFV2_PD_FactorInversedAlpha = 3 } |
LCDIF v2 PoterDuff factor mode. More... | |
enum | _lcdifv2_pd_blend_mode { kLCDIFV2_PD_Src = 0 , kLCDIFV2_PD_Atop , kLCDIFV2_PD_Over , kLCDIFV2_PD_In , kLCDIFV2_PD_Out , kLCDIFV2_PD_Dst , kLCDIFV2_PD_DstAtop , kLCDIFV2_PD_DstOver , kLCDIFV2_PD_DstIn , kLCDIFV2_PD_DstOut , kLCDIFV2_PD_Xor , kLCDIFV2_PD_Clear , kLCDIFV2_PD_Max } |
LCDIFv2 Porter Duff blend mode. Note: Don't change the enum item value. More... | |
enum | _lcdifv2_pd_layer { kLCDIFV2_PD_SrcLayer = 0 , kLCDIFV2_PD_DestLayer = 1 , kLCDIFV2_PD_LayerMax = 2 } |
LCDIFv2 Porter Duff layer. Note: Don't change the enum item value. More... | |
typedef enum _lcdifv2_line_order | lcdifv2_line_order_t |
The LCDIF v2 output line order. | |
typedef struct _lcdifv2_display_config | lcdifv2_display_config_t |
LCDIF v2 display configure structure. | |
typedef enum _lcdifv2_csc_mode | lcdifv2_csc_mode_t |
LCDIF v2 color space conversion mode. | |
typedef enum _lcdifv2_pixel_format | lcdifv2_pixel_format_t |
LCDIF v2 pixel format. | |
typedef struct _lcdifv2_buffer_config | lcdifv2_buffer_config_t |
LCDIF v2 source buffer configuration. | |
typedef enum _lcdifv2_alpha_mode | lcdifv2_alpha_mode_t |
LCDIF v2 layer alpha blending mode. | |
typedef enum _lcdifv2_pd_alpha_mode | lcdifv2_pd_alpha_mode_t |
LCDIF v2 PoterDuff alpha mode. | |
typedef enum _lcdifv2_pd_color_mode | lcdifv2_pd_color_mode_t |
LCDIF v2 PoterDuff color mode. | |
typedef enum _lcdifv2_pd_global_alpha_mode | lcdifv2_pd_global_alpha_mode_t |
LCDIF v2 PoterDuff global alpha mode. | |
typedef enum _lcdifv2_pd_factor_mode | lcdifv2_pd_factor_mode_t |
LCDIF v2 PoterDuff factor mode. | |
typedef struct _lcdifv2_blend_config | lcdifv2_blend_config_t |
LCDIF v2 layer alpha blending configuration. | |
typedef enum _lcdifv2_pd_blend_mode | lcdifv2_pd_blend_mode_t |
LCDIFv2 Porter Duff blend mode. Note: Don't change the enum item value. | |
typedef enum _lcdifv2_pd_layer | lcdifv2_pd_layer_t |
LCDIFv2 Porter Duff layer. Note: Don't change the enum item value. | |
#define | FSL_LCDIFV2_DRIVER_VERSION (MAKE_VERSION(2, 3, 2)) |
LCDIF v2 driver version. | |
#define | LCDIFV2_ADDR_CPU_2_IP(addr) (addr) |
#define | LCDIFV2_MAKE_FIFO_EMPTY_INTERRUPT(layer) (1UL << ((uint32_t)(layer) + 24U)) |
LCDIF v2 FIFO empty interrupt. | |
#define | LCDIFV2_MAKE_DMA_DONE_INTERRUPT(layer) (1UL << ((uint32_t)(layer) + 16U)) |
LCDIF v2 DMA done interrupt. | |
#define | LCDIFV2_MAKE_DMA_ERROR_INTERRUPT(layer) (1UL << ((uint32_t)(layer) + 8U)) |
LCDIF v2 DMA error interrupt. | |
#define | LCDIFV2_LUT_ENTRY_NUM 256U |
LCDIF v2 initialization and de-initialization | |
void | LCDIFV2_Init (LCDIFV2_Type *base) |
Initializes the LCDIF v2. | |
void | LCDIFV2_Deinit (LCDIFV2_Type *base) |
Deinitializes the LCDIF peripheral. | |
void | LCDIFV2_Reset (LCDIFV2_Type *base) |
Reset the LCDIF v2. | |
Display | |
void | LCDIFV2_DisplayGetDefaultConfig (lcdifv2_display_config_t *config) |
Gets the LCDIF display default configuration structure. | |
void | LCDIFV2_SetDisplayConfig (LCDIFV2_Type *base, const lcdifv2_display_config_t *config) |
Set the LCDIF v2 display configurations. | |
LUT | |
status_t | LCDIFV2_SetLut (LCDIFV2_Type *base, uint8_t layerIndex, const uint32_t *lutData, uint16_t count, bool useShadowLoad) |
Set the LUT data. | |
Layer operation | |
void | LCDIFV2_SetLayerBufferConfig (LCDIFV2_Type *base, uint8_t layerIndex, const lcdifv2_buffer_config_t *config) |
Set the layer source buffer configuration. | |
void | LCDIFV2_SetLayerBlendConfig (LCDIFV2_Type *base, uint8_t layerIndex, const lcdifv2_blend_config_t *config) |
Set the layer alpha blend mode. | |
void | LCDIFV2_SetCscMode (LCDIFV2_Type *base, uint8_t layerIndex, lcdifv2_csc_mode_t mode) |
Set the color space conversion mode. | |
Porter Duff | |
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. | |
Misc | |
status_t | LCDIFV2_GetMultiLayerGlobalAlpha (const uint8_t blendedAlpha[], uint8_t globalAlpha[], uint8_t layerCount) |
Get the global alpha values for multiple layer blend. | |
enum _lcdifv2_alpha_mode |
enum _lcdifv2_csc_mode |
enum _lcdifv2_interrupt |
The LCDIF v2 interrupts.
enum _lcdifv2_line_order |
LCDIFv2 Porter Duff blend mode. Note: Don't change the enum item value.
enum _lcdifv2_pd_layer |
LCDIF v2 pixel format.
LCDIF v2 signal polarity flags.
void LCDIFV2_Deinit | ( | LCDIFV2_Type * | base | ) |
Deinitializes the LCDIF peripheral.
base | LCDIF peripheral base address. |
brief Deinitializes the LCDIF peripheral.
param base LCDIF peripheral base address.
void LCDIFV2_DisplayGetDefaultConfig | ( | lcdifv2_display_config_t * | config | ) |
Gets the LCDIF display default configuration structure.
This function sets the configuration structure to default values. The default configuration is set to the following values.
config | Pointer to the LCDIF configuration structure. |
brief Gets the LCDIF display default configuration structure.
param config Pointer to the LCDIF configuration structure.
status_t LCDIFV2_GetMultiLayerGlobalAlpha | ( | const uint8_t | blendedAlpha[], |
uint8_t | globalAlpha[], | ||
uint8_t | layerCount | ||
) |
Get the global alpha values for multiple layer blend.
This function calculates the global alpha value for each layer based on the desired blended alpha.
When all layers use the global alpha, the relationship of blended alpha and global alpha of each layer is:
Layer 7: ba7 = ga7 Layer 6: ba6 = ga6 * (1-ga7) Layer 5: ba5 = ga5 * (1-ga6) * (1-ga7) Layer 4: ba4 = ga4 * (1-ga5) * (1-ga6) * (1-ga7) Layer 3: ba3 = ga3 * (1-ga4) * (1-ga5) * (1-ga6) * (1-ga7) Layer 2: ba2 = ga2 * (1-ga3) * (1-ga4) * (1-ga5) * (1-ga6) * (1-ga7) Layer 1: ba1 = ga1 * (1-ga2) * (1-ga3) * (1-ga4) * (1-ga5) * (1-ga6) * (1-ga7) Layer 0: ba0 = 1 * (1-ga1) * (1-ga2) * (1-ga3) * (1-ga4) * (1-ga5) * (1-ga6) * (1-ga7)
Here baN is the blended alpha of layer N, gaN is the global alpha configured to layer N.
This function calculates the global alpha based on the blended alpha. The blendedAlpha
and globalAlpha
are all arrays of size layerCount
. The first layer is a background layer, so blendedAlpha[0] is useless, globalAlpha[0] is always 255.
[in] | blendedAlpha | The desired blended alpha value, alpha range 0~255. |
[out] | globalAlpha | Calculated global alpha set to each layer register. |
[in] | layerCount | Total layer count. |
kStatus_Success | Get successfully. |
kStatus_InvalidArgument | The argument is invalid. |
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.
This function gets the blend configuration for Porter Duff blend, config->pdFactorMode is set according to layer
and mode
, other blend configurations are set to:
This is the basic Porter Duff blend configuration, user still could modify the configurations after this function.
mode | Porter Duff blend mode. |
layer | The configuration for source layer or destination layer. |
config | Pointer to the configuration. |
kStatus_Success | Get the configuration successfully. |
kStatus_InvalidArgument | The argument is invalid. |
void LCDIFV2_Init | ( | LCDIFV2_Type * | base | ) |
Initializes the LCDIF v2.
This function ungates the LCDIF v2 clock and release the peripheral reset.
base | LCDIF v2 peripheral base address. |
brief Initializes the LCDIF v2.
This function ungates the LCDIF v2 clock and release the peripheral reset.
param base LCDIF v2 peripheral base address.
void LCDIFV2_Reset | ( | LCDIFV2_Type * | base | ) |
Reset the LCDIF v2.
base | LCDIF peripheral base address. |
brief Reset the LCDIF v2.
param base LCDIF peripheral base address.
void LCDIFV2_SetCscMode | ( | LCDIFV2_Type * | base, |
uint8_t | layerIndex, | ||
lcdifv2_csc_mode_t | mode | ||
) |
Set the color space conversion mode.
Supports YUV2RGB and YCbCr2RGB.
base | LCDIFv2 peripheral base address. |
layerIndex | Index of the layer. |
mode | The conversion mode. |
brief Set the color space conversion mode.
Supports YUV2RGB and YCbCr2RGB.
param base LCDIFv2 peripheral base address. param layerIndex Index of the layer. param mode The conversion mode.
void LCDIFV2_SetDisplayConfig | ( | LCDIFV2_Type * | base, |
const lcdifv2_display_config_t * | config | ||
) |
Set the LCDIF v2 display configurations.
base | LCDIF peripheral base address. |
config | Pointer to the LCDIF configuration structure. |
brief Set the LCDIF v2 display configurations.
param base LCDIF peripheral base address. param config Pointer to the LCDIF configuration structure.
void LCDIFV2_SetLayerBlendConfig | ( | LCDIFV2_Type * | base, |
uint8_t | layerIndex, | ||
const lcdifv2_blend_config_t * | config | ||
) |
Set the layer alpha blend mode.
base | LCDIFv2 peripheral base address. |
layerIndex | Index of the CSC unit. |
config | Pointer to the blend configuration. |
brief Set the layer alpha blend mode.
param base LCDIFv2 peripheral base address. param layerIndex Index of the CSC unit. param config Pointer to the blend configuration.
void LCDIFV2_SetLayerBufferConfig | ( | LCDIFV2_Type * | base, |
uint8_t | layerIndex, | ||
const lcdifv2_buffer_config_t * | config | ||
) |
Set the layer source buffer configuration.
base | LCDIFv2 peripheral base address. |
layerIndex | Layer layerIndex. |
config | Pointer to the configuration. |
brief Set the layer source buffer configuration.
param base LCDIFv2 peripheral base address. param layerIndex Layer layerIndex. param config Pointer to the configuration.
status_t LCDIFV2_SetLut | ( | LCDIFV2_Type * | base, |
uint8_t | layerIndex, | ||
const uint32_t * | lutData, | ||
uint16_t | count, | ||
bool | useShadowLoad | ||
) |
Set the LUT data.
This function sets the specific layer LUT data, if useShadowLoad
is true, call LCDIFV2_TriggerLayerShadowLoad after this function, the LUT will be loaded to the hardware during next vertical blanking period. If useShadowLoad
is false, the LUT data is loaded to hardware directly.
base | LCDIF v2 peripheral base address. |
layerIndex | Which layer to set. |
lutData | The LUT data to load. |
count | Count of lutData . |
useShadowLoad | Use shadow load. |
kStatus_Success | Set success. |
kStatus_Fail | Previous LUT data is not loaded to hardware yet. |
brief Set the LUT data.
This function sets the specific layer LUT data, if useShadowLoad is true, call LCDIFV2_TriggerLayerShadowLoad after this function, the LUT will be loaded to the hardware during next vertical blanking period. If useShadowLoad is false, the LUT data is loaded to hardware directly.
param base LCDIF v2 peripheral base address. param layerIndex Which layer to set. param lutData The LUT data to load. param count Count of lutData. retval kStatus_Success Set success. retval kStatus_Fail Previous LUT data is not loaded to hardware yet.
lcdifv2_alpha_mode_t _lcdifv2_blend_config::alphaMode |
Alpha mode.
uint8_t _lcdifv2_blend_config::globalAlpha |
Global alpha value, only used when alphaMode is kLCDIFV2_AlphaOverride or kLCDIFV2_AlphaPoterDuff
uint8_t _lcdifv2_display_config::hbp |
Horizontal back porch.
uint8_t _lcdifv2_display_config::hfp |
Horizontal front porch.
uint8_t _lcdifv2_display_config::hsw |
HSYNC pulse width.
lcdifv2_line_order_t _lcdifv2_display_config::lineOrder |
Line order.
uint16_t _lcdifv2_display_config::panelHeight |
Display panel height, how many lines per panel.
uint16_t _lcdifv2_display_config::panelWidth |
Display panel width, pixels per line.
lcdifv2_pd_alpha_mode_t _lcdifv2_blend_config::pdAlphaMode |
PoterDuff alpha mode, only used when alphaMode is kLCDIFV2_AlphaPoterDuff
lcdifv2_pd_color_mode_t _lcdifv2_blend_config::pdColorMode |
PoterDuff color mode, only used when alphaMode is kLCDIFV2_AlphaPoterDuff
lcdifv2_pd_factor_mode_t _lcdifv2_blend_config::pdFactorMode |
PoterDuff factor mode, only used when alphaMode is kLCDIFV2_AlphaPoterDuff
lcdifv2_pd_global_alpha_mode_t _lcdifv2_blend_config::pdGlobalAlphaMode |
PoterDuff global alpha mode, only used when alphaMode is kLCDIFV2_AlphaPoterDuff
lcdifv2_pixel_format_t _lcdifv2_buffer_config::pixelFormat |
Source buffer pixel format.
uint32_t _lcdifv2_display_config::polarityFlags |
OR'ed value of _lcdifv2_polarity_flags, used to contol the signal polarity.
uint16_t _lcdifv2_buffer_config::strideBytes |
Number of bytes between two vertically adjacent pixels, suggest 64-bit aligned.
uint8_t _lcdifv2_display_config::vbp |
Vertical back porch.
uint8_t _lcdifv2_display_config::vfp |
Vrtical front porch.
uint8_t _lcdifv2_display_config::vsw |
VSYNC pulse width.