2015-09-10 01:17 AM
Hello,
I am working on Hal library. I developed new board for my project. There is a 4.3'' TFT.I use STM32F429_EVAL board example software. SDRAM and TFT are ok. They are working without problem. However, when i use fillrect or ClearLCD functions, they dont work because of DMA2D library. Because this library consist of 24bit color format. I tried but i could not handle it. Shortly, How can i change DMA2D library as 16bit colour format.I edited some parameter. For example , I edited RGB_565, void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length) { uint32_t Xaddress = 0; /* Get the line address */ //Xaddress = (hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress) + 4*(BSP_LCD_GetXSize()*Ypos + Xpos); // original Xaddress = (hltdc_eval.LayerCfg[ActiveLayer].FBStartAdress) + 2 * (BSP_LCD_GetXSize()*Ypos + Xpos); // I changed as a 16bit /* Write line */ LL_FillBuffer(ActiveLayer, (uint32_t *)Xaddress, Length, 1, 0, DrawProp[ActiveLayer].TextColor);} tmp1 = pdata & DMA2D_OCOLR_ALPHA_1; tmp2 = pdata & DMA2D_OCOLR_RED_2; tmp3 = pdata & DMA2D_OCOLR_GREEN_2; tmp4 = pdata & DMA2D_OCOLR_BLUE_2;etc. Can you help me anyone.Best.Mustafa.2015-09-16 10:02 AM
Hi aksoy.mustafa,
1-STM32F429 EVAL boardis using 32 bitcolor format (ARGB8888) and not 24 bit color format. 2-If you want to change the color format to 16 bit , you shouldmodify thedriver stm324x9i_eval_lcd.c: -Replace inside LL_ConvertLineToARGB8888() and LL_FillBuffer() functionshdma2d_eval.Init.ColorMode = DMA2D_ARGB8888;
by
hdma2d_eval.Init.ColorMode = DMA2D_RGB565;
-Also, inside BSP_LCD_LayerDefaultInit() functionreplace
Layercfg.PixelFormat = LTDC_PIXEL_FORMAT_ARGB8888;
by
Layercfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;
-And by analogy replace all macros that refer to 32 bit color format by those which refer to 16 bit.
-Shahrzad-