[N9H20] How to change color format from RGB565 to RGB888

Post Reply
9chuckyoung
Posts: 93
Joined: 28 Jan 2019, 13:49

01 Nov 2019, 10:30

Platform: N9H20
Platform resource link: https://www.nuvoton.com/hq/products/app ... _locale=en
BSP link: https://github.com/OpenNuvoton/N9H20_emWin_NonOS
BSP contains tool and BSP sample pre-built binaries: https://www.nuvoton.com/products/microp ... ware&tab=2
Sample code brief: BSP emWin sample utilizes RGB565 as default color format for performance purpose, now change RGB888 to get more quality improvement.
IDE and tool-chain: Keil professional and ARMCC5
Notice:
1. This sample will refer to modified main.c and LCDConf.c

Please note that to run the sample code we need to download the latest version of N9H20 BSP from OpenNuvoton.

2:
To modify LCDConf.c, and the source path is in \N9H20_emWin_NonOS-master\BSP\ThirdParty\emWin\Config\LCDConf.c

Before:
#define COLOR_CONVERSION GUICC_M565
#define DISPLAY_DRIVER GUIDRV_LIN_16

After:
#define COLOR_CONVERSION GUICC_M888
#define DISPLAY_DRIVER GUIDRV_LIN_32

3:
To modify main.c, and the source path is in \N9H20_emWin_NonOS-master\BSP\SampleCode\emWin\SimpleDemo\main.c

Before:
UINT8 u8FrameBuf[XSIZE_PHYS*YSIZE_PHYS*2] __attribute__((aligned(32)));
lcdFormat.ucVASrcFormat = DRVVPOST_FRAME_RGB565;

After:
UINT8 u8FrameBuf[XSIZE_PHYS*YSIZE_PHYS*4] __attribute__((aligned(32)));
lcdFormat.ucVASrcFormat = DRVVPOST_FRAME_RGBx888;
Attachments
SimpleDemo_565to888.zip
For TFT-LCD3 320x240 LCD panel
A modified LCDConf.c is included in this sample
(23.42 KiB) Downloaded 288 times

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 2 guests