lexus2k / lcdgfx

Driver for LCD displays running on Arduino/Avr/ESP32/Linux (including Rasperry) platforms
MIT License
386 stars 55 forks source link

DisplayST7789 with negative colors #125

Open lukkass222 opened 2 months ago

lukkass222 commented 2 months ago

Hello, I started testing the colors on the display7789, and I noticed that the colors were inverted. To confirm if the problem was with the display, I tested other libraries.

with tft_espi, everything worked fine.

with the Adafruit-ST7735, the colors were inverted, but in Adafruit there is the function .invertDisplay(bool), putting tft.invertDisplay(false); fixes the problem.

from that I did:

 #define ST77XX_INVOFF 0x20
 #define ST77XX_INVON 0x21

 display.getInterface().start();
 display.getInterface().send(ST77XX_INVOFF);
 display.getInterface().stop();

It's not ideal but it works

lukkass222 commented 2 months ago

ok, the display starts in inverted mode.

0x21, CMD_DELAY, 10, // INVON (21h): Display Inversion On"

lexus2k commented 2 months ago

That's interesting. All displays I had in my hands required inversion mode. The possible solution is to add invertmode API for st7789 displays.