STM32CubeMX图形配置中的设定值均是LCD面板中的相关值,STM32CubeMX会重新计算,然后生成如下的代码:
hltdc . Instance = LTDC ;
hltdc . Init . HSPolarity = LTDC_HSPOLARITY_AL ;
hltdc . Init . VSPolarity = LTDC_VSPOLARITY_AL ;
hltdc . Init . DEPolarity = LTDC_DEPOLARITY_AL ;
hltdc . Init . PCPolarity = LTDC_PCPOLARITY_IPC ;
hltdc . Init . HorizontalSync = 0 ; //HSW:Horizontal Synchronization Height
hltdc . Init . VerticalSync = 0 ; //VSW:Vertical Synchronization Height
hltdc . Init . AccumulatedHBP = 6 ; //HBP
hltdc . Init . AccumulatedVBP = 6 ; //VBP
hltdc . Init . AccumulatedActiveW = 1030 ; //自动计算 HBP + Active Width - 1;
hltdc . Init . AccumulatedActiveH = 774 ; //自动计算 VBP + Active Heigh - 1;
hltdc . Init . TotalWidth = 1036 ; //自动计算 HSW + HBP + Active Width - 1;
hltdc . Init . TotalHeigh = 782 ; //自动计算 VSW + VBP + Active Heigh - 1;
...
if ( HAL_LTDC_Init (& hltdc ) != HAL_OK )
{
_Error_Handler ( __FILE__ , __LINE__ );
}
|