ST7735 Display Orientation and Color Configuration
The ST7735 is commonly used as the driver chip for small TFT screens. This article provides guidance on configuring the refresh direction (rotating or flipping the screen) and the RGB or BGR color format.
Analysis
This configuration corresponds to register address 0x36 of the driver chip, which is covered on page 110 of the datasheet.
The commonly used initialization values are as follows (the refresh directions have not been strictly tested — please try them out yourself!):
| Color format \ Refresh direction | Portrait | Landscape |
|---|---|---|
| RGB | 0x00, 0xC0 | 0xA0, 0x60, 0x70 |
| BGR | 0x08, 0xC8 | 0xA8, 0x68, 0x78 |
I’d also like to recommend an SPI screen library for the ESP32 implemented in pure C: esp-idf-ili9340.