Replies: 3 comments
-
I also got an inverted and rotated display. |
Beta Was this translation helpful? Give feedback.
-
See #41 |
Beta Was this translation helpful? Give feedback.
-
Hi Max, The ST7789 has a register called LCMCTRL. This can invert the MADCTL bits. One of the bits that gets set to invert is the RGB color mode when #define INIT_SEQUENCE_3 is enabled. This is set in ST7789_Init.h When INIT_SEQUENCE_3 is not defined, LCMCTRL = 0x0C When INIT_SEQUENCE_3 is defined, LCMCTRL = 0x2C 73, Dave |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi Max,
For information, whilst looking at the inverted display issue raised by a user, I noticed an inconsistency in the display user setup file in the TFT_eSPI libraries.
From the ralphxavier information which points to the following path.
https://github.com/Xinyuan-LilyGO/T-Display-S3/blob/main/lib/TFT_eSPI/User_Setups/Setup206_LilyGo_T_Display_S3.h
// #define INIT_SEQUENCE_3 // Using this initialisation sequence improves the display image
#define CGRAM_OFFSET
// #define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
From the Chinese source library.
https://github.com/zhang-chong/4732mini/blob/master/libraries/TFT_eSPI_DynamicSpeed/User_Setups/Setup206_LilyGo_T_Display_S3.h
#define INIT_SEQUENCE_3 // Using this initialisation sequence improves the display image
#define CGRAM_OFFSET
#define TFT_RGB_ORDER TFT_RGB // Colour order Red-Green-Blue
//#define TFT_RGB_ORDER TFT_BGR // Colour order Blue-Green-Red
I experimented with the settings and found the following.
If #define INIT_SEQUENCE_3 is uncommented, the #define TFT_RGB_ORDER has no effect
If #define INIT_SEQUENCE_3 is commented out, the #define TFT_RGB_ORDER has an effect.
The #define TFT_RGB_ORDER TFT_BGR produces the correct behaviour on the setup I have.
It appears that something in the INIT_SEQUENCE_3 affects the RGB order, but I have not investigated further.
73, Dave
Beta Was this translation helpful? Give feedback.
All reactions