STM32F439 LCD EVM - TFT LCD Test
STM32F4 LTDC 핀맵
STM32F439 TFT-LCD 초기화 코드
uint8_t BSP_LCD_Init(void)
{
/* LTDC Configuration ----------------------------------------------------*/
LtdcHandler.Instance = LTDC;
/* Configure horizontal synchronization width */
LtdcHandler.Init.HorizontalSync = HSYNC;
/* Configure vertical synchronization height */
LtdcHandler.Init.VerticalSync = VSYNC;
/* Configure accumulated horizontal back porch */
LtdcHandler.Init.AccumulatedHBP = HBP;
/* Configure accumulated vertical back porch */
LtdcHandler.Init.AccumulatedVBP = VBP;
/* Configure accumulated active width */
LtdcHandler.Init.AccumulatedActiveW = ACTIVE_W-2;
/* Configure accumulated active height */
LtdcHandler.Init.AccumulatedActiveH = ACTIVE_H;
/* Configure total width */
LtdcHandler.Init.TotalWidth = TOTAL_WIDTH;
/* Configure total height */
LtdcHandler.Init.TotalHeigh = TOTAL_HEIGHT;
/* Configure R,G,B component values for LCD background color */
LtdcHandler.Init.Backcolor.Red= 0;
LtdcHandler.Init.Backcolor.Blue= 0;
LtdcHandler.Init.Backcolor.Green= 0;
/* LCD clock configuration */
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
PeriphClkInitStruct.PLLSAI.PLLSAIN = _PLLSAIN_CLK;
PeriphClkInitStruct.PLLSAI.PLLSAIR = PLLSAIR_DIV;
PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct);
/* Polarity */
LtdcHandler.Init.HSPolarity = LTDC_HSPOLARITY_AL;
LtdcHandler.Init.VSPolarity = LTDC_VSPOLARITY_AL;
LtdcHandler.Init.DEPolarity = LTDC_DEPOLARITY_AL;
LtdcHandler.Init.PCPolarity = LTDC_PCPOLARITY_IPC;
MspInit();
HAL_LTDC_Init(&LtdcHandler);
/* Initialize the SDRAM */
BSP_SDRAM_Init();
/* Initialize the font */
BSP_LCD_SetFont(&LCD_DEFAULT_FONT);
return LCD_OK;
}
STM32F439 EVM TFT-LCD커넥터 핀맵
기존 7" TFT-LCD 모듈 커넥터 연결하여 다양한 LCD 테스트 가능하다.
STM32F439 TFT LCD 제어 예제
아래는 간단히 LCD 초기화 하고 LCD에 Text 표시하는 예제이다.
STM32F439 TFT LCD 제어 테스트 예제 동영상
SD Card에 있는 BMP파일을읽어 TFT LCD에 출력하는 동영상