kdschlosser / lvgl_micropython

LVGL module for MicroPython
MIT License
42 stars 11 forks source link

RGB -> BGR on ili9341 #55

Closed zelogik closed 2 weeks ago

zelogik commented 2 weeks ago

Hi,

I have read than putting: color_byte_order=BYTE_ORDER_BGR, in the contructor of the display should work 2 weeks ago (in another issue on this repo)

But have you done some work there too ? because with or without putting that, the Red is displayed Blue, and blue is red. I can have a look at it if you say that you have touched something on that driver :D

kdschlosser commented 2 weeks ago

you need to set rgb565_byte_swap to True and leave color_byte_order set to it's default.

the color_byte_order is how the data gets stored in a displays memory where as rgb565_byte_swap affects how the bytes are transmitted.

I am making an assumption that you are using 16 bit color depth (RGB565)

zelogik commented 2 weeks ago

With a constructor like that: display = ili9341.ILI9341( ... color_space=lv.COLOR_FORMAT.RGB565, color_byte_order=ili9341.BYTE_ORDER_BGR, rgb565_byte_swap=True ) Tested with rgb565_byte_swap True|False, and color_byte_order commented|RBG|BGR

exactly the same wrong color order ...

kdschlosser commented 2 weeks ago

I am going to have to make a change to the code, give me a little while to do that.

kdschlosser commented 2 weeks ago

OK I made the changes needed to the driver for the display IC. so this should be all set.