Oct. 04, 2018
Page
15
of 18
Rev 1.00
M480 emWin
5
Change Display Panel
5.1 emWin Display Configuration
emWin
declares
its
display
panel
resolution
in
LCDConf.c
under
the
ThirdParty\emWin\Config\ directory. The resolution is different from the touch panel resolution
defined in the M48XTouchPanel.h. This is because the panel is a portrait display and data is
swapped before output for a landscape view by LCD driver IC.
......
// Physical display size
#define XSIZE_PHYS 240
#define YSIZE_PHYS 320
In the LCDConf.c file, the panel orientation and control functions are also defined. These
settings need to be modified according to the display panel attached to the system.
......
void LCD_WR_REG(uint8_t cmd)
{
EBI0_WRITE_DATA16(0x00030000, cmd);
}
......
uint8_t LCD_RD_DATA(void)
{
return EBI0_READ_DATA16(0x00030000);
}
void LCD_X_Config(void)
{
......
// Orientation
Config.Orientation = GUI_MIRROR_X | GUI_MIRROR_Y | GUI_SWAP_XY;
GUIDRV_FlexColor_Config(pDevice, &Config);
// Set controller and operation mode
PortAPI.pfWrite16_A0 = LCD_WR_REG;
PortAPI.pfWrite16_A1 = LCD_WR_DATA;
PortAPI.pfWriteM16_A1 = LcdWriteDataMultiple;
PortAPI.pfReadM16_A1 = LcdReadDataMultiple;
GUIDRV_FlexColor_SetFunc(pDevice,
&PortAPI,
GUIDRV_FLEXCOLOR_F66709,