Make ST7789 drivers consistent

Simplified driver ST7789_2_DRIVER not supports 135 x 240 display.
This will not fix #763 since user specifies alternative ST7789_DRIVER which already supports 135x240 displays.
This commit is contained in:
Bodmer
2020-10-02 20:47:00 +01:00
parent 49cef1f35d
commit ef93dbe687
4 changed files with 43 additions and 11 deletions

View File

@@ -5,8 +5,16 @@
switch (rotation) {
case 0: // Portrait
#ifdef CGRAM_OFFSET
colstart = 0;
rowstart = 0;
if (_init_width == 135)
{
colstart = 52;
rowstart = 40;
}
else
{
colstart = 0;
rowstart = 0;
}
#endif
writedata(TFT_MAD_COLOR_ORDER);
@@ -16,8 +24,16 @@
case 1: // Landscape (Portrait + 90)
#ifdef CGRAM_OFFSET
colstart = 0;
rowstart = 0;
if (_init_width == 135)
{
colstart = 40;
rowstart = 53;
}
else
{
colstart = 0;
rowstart = 0;
}
#endif
writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_COLOR_ORDER);
@@ -27,8 +43,16 @@
case 2: // Inverter portrait
#ifdef CGRAM_OFFSET
colstart = 0;
rowstart = 80;
if (_init_width == 135)
{
colstart = 53;
rowstart = 40;
}
else
{
colstart = 0;
rowstart = 80;
}
#endif
writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);
@@ -37,8 +61,16 @@
break;
case 3: // Inverted landscape
#ifdef CGRAM_OFFSET
colstart = 80;
rowstart = 0;
if (_init_width == 135)
{
colstart = 40;
rowstart = 52;
}
else
{
colstart = 80;
rowstart = 0;
}
#endif
writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_COLOR_ORDER);

View File

@@ -16,7 +16,7 @@
#ifndef _TFT_eSPIH_
#define _TFT_eSPIH_
#define TFT_ESPI_VERSION "2.2.21"
#define TFT_ESPI_VERSION "2.2.22"
/***************************************************************************************
** Section 1: Load required header files

View File

@@ -1,6 +1,6 @@
{
"name": "TFT_eSPI",
"version": "2.2.21",
"version": "2.2.22",
"keywords": "Arduino, tft, ePaper, display, STM32, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789, RM68140",
"description": "A TFT and ePaper SPI graphics library with optimisation for ESP8266, ESP32 and STM32",
"repository":

View File

@@ -1,5 +1,5 @@
name=TFT_eSPI
version=2.2.21
version=2.2.22
author=Bodmer
maintainer=Bodmer
sentence=TFT graphics library for Arduino processors with performance optimisation for STM32, ESP8266 and ESP32