diff --git a/examples/PDQgraphicstest/PDQgraphicstest.ino b/examples/PDQgraphicstest/PDQgraphicstest.ino index 53ad7ab3..7f345059 100644 --- a/examples/PDQgraphicstest/PDQgraphicstest.ino +++ b/examples/PDQgraphicstest/PDQgraphicstest.ino @@ -27,7 +27,7 @@ Arduino_GFX *gfx = new Arduino_ILI9488_18bit(bus, -1 /* RST */, 1 /* rotation */ #elif defined(TTGO_T_DISPLAY) #define TFT_BL 4 Arduino_DataBus *bus = new Arduino_ESP32SPI(16 /* DC */, 5 /* CS */, 18 /* SCK */, 19 /* MOSI */, -1 /* MISO */); -Arduino_GFX *gfx = new Arduino_ST7789(bus, 23 /* RST */, 2 /* rotation */, true /* IPS */, 135 /* width */, 240 /* height */, 53 /* col offset 1 */, 40 /* row offset 1 */, 52 /* col offset 2 */, 40 /* row offset 2 */); +Arduino_GFX *gfx = new Arduino_ST7789(bus, 23 /* RST */, 0 /* rotation */, true /* IPS */, 135 /* width */, 240 /* height */, 53 /* col offset 1 */, 40 /* row offset 1 */, 52 /* col offset 2 */, 40 /* row offset 2 */); #elif defined(WT32_SC01) #define TFT_BL 23 @@ -51,13 +51,13 @@ Arduino_GFX *gfx = new Arduino_ILI9342(bus, 33 /* RST */, 0 /* rotation */); // #define TFT_BL 14 Arduino_DataBus *bus = new Arduino_ESP32SPI(21 /* DC */, 5 /* CS */, SCK, MOSI, MISO); Arduino_GFX *gfx = new Arduino_ILI9341(bus, -1 /* RST */, 3 /* rotation */); -// Arduino_ST7789 *gfx = new Arduino_ST7789(bus, -1 /* RST */, 1 /* rotation */, true /* IPS */); +// Arduino_ST7789 *gfx = new Arduino_ST7789(bus, -1 /* RST */, 3 /* rotation */, true /* IPS */); /* TTGO T-Watch */ #elif defined(ARDUINO_T) || defined(ARDUINO_TWATCH_BASE) || defined(ARDUINO_TWATCH_2020_V1) || defined(ARDUINO_TWATCH_2020_V2) // #define TFT_BL 12 Arduino_DataBus *bus = new Arduino_ESP32SPI(27 /* DC */, 5 /* CS */, 18 /* SCK */, 19 /* MOSI */, -1 /* MISO */); -Arduino_GFX *gfx = new Arduino_ST7789(bus, -1 /* RST */, 2 /* rotation */, true /* IPS */, 240, 240, 0, 80); +Arduino_GFX *gfx = new Arduino_ST7789(bus, -1 /* RST */, 0 /* rotation */, true /* IPS */, 240, 240, 0, 80); #else /* not selected specific hardware */ @@ -310,7 +310,7 @@ Arduino_GFX *gfx = new Arduino_ILI9341(bus, TFT_RST, 0 /* rotation */, false /* // 1.69" IPS round corner LCD 240x280 // Arduino_GFX *gfx = new Arduino_ST7789(bus, TFT_RST, 0 /* rotation */, true /* IPS */, 240 /* width */, 280 /* height */, 0 /* col offset 1 */, 20 /* row offset 1 */, 0 /* col offset 2 */, 20 /* row offset 2 */); // 1.3"/1.5" square IPS LCD 240x240 -// Arduino_GFX *gfx = new Arduino_ST7789(bus, TFT_RST, 2 /* rotation */, true /* IPS */, 240 /* width */, 240 /* height */, 0 /* col offset 1 */, 80 /* row offset 1 */); +// Arduino_GFX *gfx = new Arduino_ST7789(bus, TFT_RST, 0 /* rotation */, true /* IPS */, 240 /* width */, 240 /* height */, 0 /* col offset 1 */, 80 /* row offset 1 */); // 1.14" IPS LCD 135x240 TTGO T-Display // Arduino_GFX *gfx = new Arduino_ST7789(bus, TFT_RST, 0 /* rotation */, true /* IPS */, 135 /* width */, 240 /* height */, 53 /* col offset 1 */, 40 /* row offset 1 */, 52 /* col offset 2 */, 40 /* row offset 2 */); diff --git a/src/Arduino_GFX_Library.cpp b/src/Arduino_GFX_Library.cpp index 3b538c41..44cfde21 100644 --- a/src/Arduino_GFX_Library.cpp +++ b/src/Arduino_GFX_Library.cpp @@ -25,7 +25,7 @@ Arduino_GFX *create_default_Arduino_GFX() #elif defined(ODROID_GO) return new Arduino_ILI9341(bus, DF_GFX_RST, 3 /* rotation */); #elif defined(TTGO_T_WATCH) - return new Arduino_ST7789(bus, DF_GFX_RST, 2 /* rotation */, true /* IPS */, 240, 240, 0, 80); + return new Arduino_ST7789(bus, DF_GFX_RST, 0 /* rotation */, true /* IPS */, 240, 240, 0, 80); #else return new Arduino_ILI9341(bus, DF_GFX_RST, 0 /* rotation */); #endif diff --git a/src/display/Arduino_ST7789.cpp b/src/display/Arduino_ST7789.cpp index 8a20b78f..b5219fb7 100644 --- a/src/display/Arduino_ST7789.cpp +++ b/src/display/Arduino_ST7789.cpp @@ -34,19 +34,19 @@ void Arduino_ST7789::setRotation(uint8_t r) switch (_rotation) { case 0: - r = ST7789_MADCTL_MX | ST7789_MADCTL_MY | ST7789_MADCTL_RGB; + r = ST7789_MADCTL_RGB; break; case 1: - r = ST7789_MADCTL_MY | ST7789_MADCTL_MV | ST7789_MADCTL_RGB; + r = ST7789_MADCTL_MX | ST7789_MADCTL_MV | ST7789_MADCTL_RGB; break; case 2: - r = ST7789_MADCTL_RGB; + r = ST7789_MADCTL_MX | ST7789_MADCTL_MY | ST7789_MADCTL_RGB; break; case 3: - r = ST7789_MADCTL_MX | ST7789_MADCTL_MV | ST7789_MADCTL_RGB; + r = ST7789_MADCTL_MY | ST7789_MADCTL_MV | ST7789_MADCTL_RGB; break; }