STM32L4xx_HAL_Driver  1.14.0
Initialization and Configuration functions

Initialization and Configuration functions. More...

Functions

HAL_StatusTypeDef HAL_LTDCEx_StructInitFromVideoConfig (LTDC_HandleTypeDef *hltdc, DSI_VidCfgTypeDef *VidCfg)
 Retrieve common parameters from DSI Video mode configuration structure. More...
 
HAL_StatusTypeDef HAL_LTDCEx_StructInitFromAdaptedCommandConfig (LTDC_HandleTypeDef *hltdc, DSI_CmdCfgTypeDef *CmdCfg)
 Retrieve common parameters from DSI Adapted command mode configuration structure. More...
 

Detailed Description

Initialization and Configuration functions.

 ===============================================================================
                ##### Initialization and Configuration functions #####
 ===============================================================================
    [..]  This section provides functions allowing to:
      (+) Initialize and configure the LTDC

Function Documentation

◆ HAL_LTDCEx_StructInitFromAdaptedCommandConfig()

HAL_StatusTypeDef HAL_LTDCEx_StructInitFromAdaptedCommandConfig ( LTDC_HandleTypeDef hltdc,
DSI_CmdCfgTypeDef CmdCfg 
)

Retrieve common parameters from DSI Adapted command mode configuration structure.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
CmdCfgpointer to a DSI_CmdCfgTypeDef structure that contains the DSI command mode configuration parameters
Note
The implementation of this function is taking into account the LTDC polarities inversion as described in the current LTDC specification
Return values
HALstatus

Definition at line 107 of file stm32l4xx_hal_ltdc_ex.c.

108 {
109  /* Retrieve signal polarities from DSI */
110 
111  /* The following polarities are inverted:
112  LTDC_DEPOLARITY_AL <-> LTDC_DEPOLARITY_AH
113  LTDC_VSPOLARITY_AL <-> LTDC_VSPOLARITY_AH
114  LTDC_HSPOLARITY_AL <-> LTDC_HSPOLARITY_AH)*/
115 
116  /* Note 1 : Code in line w/ Current LTDC specification */
117  hltdc->Init.DEPolarity = (CmdCfg->DEPolarity == DSI_DATA_ENABLE_ACTIVE_HIGH) ? LTDC_DEPOLARITY_AL : LTDC_DEPOLARITY_AH;
118  hltdc->Init.VSPolarity = (CmdCfg->VSPolarity == DSI_VSYNC_ACTIVE_HIGH) ? LTDC_VSPOLARITY_AL : LTDC_VSPOLARITY_AH;
119  hltdc->Init.HSPolarity = (CmdCfg->HSPolarity == DSI_HSYNC_ACTIVE_HIGH) ? LTDC_HSPOLARITY_AL : LTDC_HSPOLARITY_AH;
120 
121  /* Note 2: Code to be used in case LTDC polarities inversion updated in the specification */
122  /* hltdc->Init.DEPolarity = CmdCfg->DEPolarity << 29;
123  hltdc->Init.VSPolarity = CmdCfg->VSPolarity << 29;
124  hltdc->Init.HSPolarity = CmdCfg->HSPolarity << 29; */
125 
126  return HAL_OK;
127 }
return HAL_OK

◆ HAL_LTDCEx_StructInitFromVideoConfig()

HAL_StatusTypeDef HAL_LTDCEx_StructInitFromVideoConfig ( LTDC_HandleTypeDef hltdc,
DSI_VidCfgTypeDef VidCfg 
)

Retrieve common parameters from DSI Video mode configuration structure.

Parameters
hltdcpointer to a LTDC_HandleTypeDef structure that contains the configuration information for the LTDC.
VidCfgpointer to a DSI_VidCfgTypeDef structure that contains the DSI video mode configuration parameters
Note
The implementation of this function is taking into account the LTDC polarities inversion as described in the current LTDC specification
Return values
HALstatus

Definition at line 71 of file stm32l4xx_hal_ltdc_ex.c.

72 {
73  /* Retrieve signal polarities from DSI */
74 
75  /* The following polarity is inverted:
76  LTDC_DEPOLARITY_AL <-> LTDC_DEPOLARITY_AH */
77 
78  /* Note 1 : Code in line w/ Current LTDC specification */
79  hltdc->Init.DEPolarity = (VidCfg->DEPolarity == DSI_DATA_ENABLE_ACTIVE_HIGH) ? LTDC_DEPOLARITY_AL : LTDC_DEPOLARITY_AH;
80  hltdc->Init.VSPolarity = (VidCfg->VSPolarity == DSI_VSYNC_ACTIVE_HIGH) ? LTDC_VSPOLARITY_AH : LTDC_VSPOLARITY_AL;
81  hltdc->Init.HSPolarity = (VidCfg->HSPolarity == DSI_HSYNC_ACTIVE_HIGH) ? LTDC_HSPOLARITY_AH : LTDC_HSPOLARITY_AL;
82 
83  /* Note 2: Code to be used in case LTDC polarities inversion updated in the specification */
84  /* hltdc->Init.DEPolarity = VidCfg->DEPolarity << 29;
85  hltdc->Init.VSPolarity = VidCfg->VSPolarity << 29;
86  hltdc->Init.HSPolarity = VidCfg->HSPolarity << 29; */
87 
88  /* Retrieve vertical timing parameters from DSI */
89  hltdc->Init.VerticalSync = VidCfg->VerticalSyncActive - 1U;
90  hltdc->Init.AccumulatedVBP = VidCfg->VerticalSyncActive + VidCfg->VerticalBackPorch - 1U;
91  hltdc->Init.AccumulatedActiveH = VidCfg->VerticalSyncActive + VidCfg->VerticalBackPorch + VidCfg->VerticalActive - 1U;
92  hltdc->Init.TotalHeigh = VidCfg->VerticalSyncActive + VidCfg->VerticalBackPorch + VidCfg->VerticalActive + VidCfg->VerticalFrontPorch - 1U;
93 
94  return HAL_OK;
95 }
return HAL_OK