cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F756G-Eval LCD Pixel Format

Posted on November 28, 2016 at 18:01

Hi. I'm trying to try something on LCD interface with the evaluation board. I want that the LCD module work with RGB565 interface but the colors are not correct when I set everything (or I'm thinking I set everything to RGB565).

I've changed the LCD color values from ARGB8888 to RGB565 like as;

&sharpdefine LCD_COLOR_BLUE          ((uint16_t)0x001F)

&sharpdefine LCD_COLOR_GREEN         ((uint16_t)0x07E0)

&sharpdefine LCD_COLOR_RED           ((uint16_t)0xF800)

&sharpdefine LCD_COLOR_CYAN          ((uint16_t)0x07FF)

&sharpdefine LCD_COLOR_MAGENTA       ((uint16_t)0xF81F)

&sharpdefine LCD_COLOR_YELLOW        ((uint16_t)0xFFE0)

&sharpdefine LCD_COLOR_LIGHTBLUE     ((uint16_t)0x841F)

&sharpdefine LCD_COLOR_LIGHTGREEN    ((uint16_t)0x87F0)

&sharpdefine LCD_COLOR_LIGHTRED      ((uint16_t)0xFC10)

&sharpdefine LCD_COLOR_LIGHTCYAN     ((uint16_t)0x87FF)

&sharpdefine LCD_COLOR_LIGHTMAGENTA  ((uint16_t)0xFC1F)

&sharpdefine LCD_COLOR_LIGHTYELLOW   ((uint16_t)0xFFF0)

&sharpdefine LCD_COLOR_DARKBLUE      ((uint16_t)0x0010)

&sharpdefine LCD_COLOR_DARKGREEN     ((uint16_t)0x0400)

&sharpdefine LCD_COLOR_DARKRED       ((uint16_t)0x8000)

&sharpdefine LCD_COLOR_DARKCYAN      ((uint16_t)0x0410)

&sharpdefine LCD_COLOR_DARKMAGENTA   ((uint16_t)0x8010)

&sharpdefine LCD_COLOR_DARKYELLOW    ((uint16_t)0x8400)

&sharpdefine LCD_COLOR_WHITE         ((uint16_t)0xFFFF)

&sharpdefine LCD_COLOR_LIGHTGRAY     ((uint16_t)0xDE7B)

&sharpdefine LCD_COLOR_GRAY          ((uint16_t)0x8410)

&sharpdefine LCD_COLOR_DARKGRAY      ((uint16_t)0x4208)

&sharpdefine LCD_COLOR_BLACK         ((uint16_t)0x0000)

&sharpdefine LCD_COLOR_BROWN         ((uint16_t)0xA985)

&sharpdefine LCD_COLOR_ORANGE        ((uint16_t)0xFD00)

&sharpdefine LCD_COLOR_TRANSPARENT   ((uint16_t)0x0000)

and I've changed also;

BSP_LCD_LayerDefaultInit(uint16_t LayerIndex, uint32_t FB_Address)

{

...

layer_cfg.PixelFormat = LTDC_PIXEL_FORMAT_RGB565;

...

}

static void LL_FillBuffer(uint32_t LayerIndex, void *pDst, uint32_t xSize, uint32_t ySize, uint32_t OffLine, uint32_t ColorIndex)

{

...

hDma2dEval.InitColorMode = DMA2D_OUTPUT_RGB565;

...

}

static void LL_ConvertLineToARGB8888(void *pSrc, void *pDst, uint32_t xSize, uint32_t ColorMode)

{

...

  hDma2dEval.Init.ColorMode = DMA2D_OUTPUT_RGB565;

...

}

but when I want to draw some white things on the screen it's drawing cyan. And the strings are not seem correctly on the screen. I'm going to add an image but now I cannot.

Thanks.

Edit: I've attached the files. I can't find anything about the LCD on the internet.

#stm32f756g-eval
3 REPLIES 3
Posted on November 29, 2016 at 09:40

Probably the LCD does not support RGB565 format.

slimen
Senior
Posted on November 29, 2016 at 10:49

Hello,

I recommend to review the ''Bitmap converter'' for emWin that you find in the STemwin package and refer to the emwin user manual in Chapter 10 Bitmap Converter: 10.3 Color conversion or refer to this

https://www.segger.com/emwin-bitmap-converter.html

LCD supports RGB565, you can refer to the 

http://www.st.com/content/ccc/resource/technical/document/reference_manual/c5/cf/ef/52/c0/f1/4b/fa/DM00124865.pdf/files/DM00124865.pdf/jcr:content/translations/en.DM00124865.pdf

 your reference on this topic and you can review the LCD-TFT Display Controller (LTDC) section for more clarification.

Have a look to LTDC examples under STM32CubeF7 package, it may be helpful: 

STM32Cube_FW_F7_V1.5.1\Projects\STM32756G_EVAL\Examples\LTDC

Regards
Posted on November 29, 2016 at 13:11

Hello. Thanks for the reply but I mean probably the TFT-LCD screen does not support the RGB565 format. I know LTDC and DMA2D support. Sorry for the bad explain. I used NXP's bitmap converter utility but I think they are using same method. Because when I convert an image to ARGB8888 I can do what I want but when changing the all the peripherals to RGB565 screen can't show what I want. Thanks again.