In the emWin documentation it says that
GUICC_565 = BGR
GUICC_M565 = RGB
In the IL9341 documentation it says Memory Access Control 36h bit D3 is BGR... and
D3 = 0 = RGB Color Filter Panel
D3 = 1 = BGR Color Filter Panel.
I can see that when I initialize the screen that emWin sends 0x36 0x20 .. .in other words it sends D3=0=RGB
Then I can send Read MADCTRL 0b and I get
0x20
So the emWin write appears to have worked.
Given all of that it seems like it would be correct to
pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, GUICC_M565, 0, 0); // Setup RGB Color Component
But... that will result in the Red and Blue flipped... so to make it work I need to do
pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, GUICC_565, 0, 0); // Setup BGR Color Component
All I can figure is that I dont understand something in the ILI9341 data sheet.
What am I missing here?
Thanks,
Alan
GUICC_565 = BGR
GUICC_M565 = RGB
In the IL9341 documentation it says Memory Access Control 36h bit D3 is BGR... and
D3 = 0 = RGB Color Filter Panel
D3 = 1 = BGR Color Filter Panel.
I can see that when I initialize the screen that emWin sends 0x36 0x20 .. .in other words it sends D3=0=RGB
Then I can send Read MADCTRL 0b and I get
0x20
So the emWin write appears to have worked.
Given all of that it seems like it would be correct to
pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, GUICC_M565, 0, 0); // Setup RGB Color Component
But... that will result in the Red and Blue flipped... so to make it work I need to do
pDevice = GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, GUICC_565, 0, 0); // Setup BGR Color Component
All I can figure is that I dont understand something in the ILI9341 data sheet.
What am I missing here?
Thanks,
Alan
The post was edited 1 time, last by iotexpert.com ().