almindor / mipidsi

MIPI Display Serial Interface unified driver
MIT License
108 stars 46 forks source link

Switched to Bgr to fix Red/Blue colours being swapped #13

Closed KerryRJ closed 2 years ago

KerryRJ commented 2 years ago

Fixes #10 for the st7735s.

KerryRJ commented 2 years ago

The datasheets that I have referenced stipulate RGB565.

Checking the C code showed that Big Endian was used to write the pixel data. I briefly tried using Little Endian to write the data instead. This solved the red/blue problem but then created a problem with the 6 bits for green. Switching the MADCTL bit and the ColourFormat solves red/green/blue for this particular device.

I do not have additional st7735s based devices to verify if this will work for all iterations. Making it configurable would be a good solution. At this point in time I do not have enough experience to do this.