STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
stm32f4xx_hal_ltdc_ex.c
Go to the documentation of this file.
1
19/* Includes ------------------------------------------------------------------*/
20#include "stm32f4xx_hal.h"
21
26#if defined(HAL_LTDC_MODULE_ENABLED) && defined(HAL_DSI_MODULE_ENABLED)
27
28#if defined (LTDC) && defined (DSI)
29
35/* Private typedef -----------------------------------------------------------*/
36/* Private define ------------------------------------------------------------*/
37/* Private macro -------------------------------------------------------------*/
38/* Private variables ---------------------------------------------------------*/
39/* Private function prototypes -----------------------------------------------*/
40/* Exported functions --------------------------------------------------------*/
41
71{
72 /* Retrieve signal polarities from DSI */
73
74 /* The following polarity is inverted:
75 LTDC_DEPOLARITY_AL <-> LTDC_DEPOLARITY_AH */
76
77#if !defined(POLARITIES_INVERSION_UPDATED)
78 /* Note 1 : Code in line w/ Current LTDC specification */
79 hltdc->Init.DEPolarity = (VidCfg->DEPolarity == \
83#else
84 /* Note 2: Code to be used in case LTDC polarities inversion updated in the specification */
85 hltdc->Init.DEPolarity = VidCfg->DEPolarity << 29;
86 hltdc->Init.VSPolarity = VidCfg->VSPolarity << 29;
87 hltdc->Init.HSPolarity = VidCfg->HSPolarity << 29;
88#endif /* POLARITIES_INVERSION_UPDATED */
89
90 /* Retrieve vertical timing parameters from DSI */
91 hltdc->Init.VerticalSync = VidCfg->VerticalSyncActive - 1U;
92 hltdc->Init.AccumulatedVBP = VidCfg->VerticalSyncActive + VidCfg->VerticalBackPorch - 1U;
93 hltdc->Init.AccumulatedActiveH = VidCfg->VerticalSyncActive + VidCfg->VerticalBackPorch + \
94 VidCfg->VerticalActive - 1U;
95 hltdc->Init.TotalHeigh = VidCfg->VerticalSyncActive + VidCfg->VerticalBackPorch + \
96 VidCfg->VerticalActive + VidCfg->VerticalFrontPorch - 1U;
97
98 return HAL_OK;
99}
100
112{
113 /* Retrieve signal polarities from DSI */
114
115 /* The following polarities are inverted:
116 LTDC_DEPOLARITY_AL <-> LTDC_DEPOLARITY_AH
117 LTDC_VSPOLARITY_AL <-> LTDC_VSPOLARITY_AH
118 LTDC_HSPOLARITY_AL <-> LTDC_HSPOLARITY_AH)*/
119
120#if !defined(POLARITIES_INVERSION_UPDATED)
121 /* Note 1 : Code in line w/ Current LTDC specification */
122 hltdc->Init.DEPolarity = (CmdCfg->DEPolarity == \
126#else
127 /* Note 2: Code to be used in case LTDC polarities inversion updated in the specification */
128 hltdc->Init.DEPolarity = CmdCfg->DEPolarity << 29;
129 hltdc->Init.VSPolarity = CmdCfg->VSPolarity << 29;
130 hltdc->Init.HSPolarity = CmdCfg->HSPolarity << 29;
131#endif /* POLARITIES_INVERSION_UPDATED */
132 return HAL_OK;
133}
134
147#endif /* LTDC && DSI */
148
149#endif /* HAL_LTCD_MODULE_ENABLED && HAL_DSI_MODULE_ENABLED */
150
#define DSI_DATA_ENABLE_ACTIVE_HIGH
#define DSI_HSYNC_ACTIVE_HIGH
#define DSI_VSYNC_ACTIVE_HIGH
HAL_StatusTypeDef HAL_LTDCEx_StructInitFromVideoConfig(LTDC_HandleTypeDef *hltdc, DSI_VidCfgTypeDef *VidCfg)
Retrieve common parameters from DSI Video mode configuration structure.
HAL_StatusTypeDef HAL_LTDCEx_StructInitFromAdaptedCommandConfig(LTDC_HandleTypeDef *hltdc, DSI_CmdCfgTypeDef *CmdCfg)
Retrieve common parameters from DSI Adapted command mode configuration structure.
#define LTDC_DEPOLARITY_AH
#define LTDC_DEPOLARITY_AL
#define LTDC_HSPOLARITY_AL
#define LTDC_HSPOLARITY_AH
#define LTDC_VSPOLARITY_AL
#define LTDC_VSPOLARITY_AH
This file contains all the functions prototypes for the HAL module driver.
HAL_StatusTypeDef
HAL Status structures definition
@ HAL_OK
DSI Adapted command mode configuration.
DSI Video mode configuration.
LTDC handle Structure definition.
LTDC_InitTypeDef Init