Page 1 of 1

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

Posted: 01 Nov 2019, 10:30
by 9chuckyoung
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;