From d4ff3c8dce57e2269c6c5784d4ea7be73ba850d2 Mon Sep 17 00:00:00 2001 From: Gavin Smalley Date: Wed, 7 Nov 2018 14:56:27 +0000 Subject: [PATCH 1/3] Add support for red-tabbed 80x160 screen. --- TFT_Drivers/ST7735_Defines.h | 5 +++++ TFT_Drivers/ST7735_Init.h | 6 ++++++ TFT_Drivers/ST7735_Rotation.h | 16 ++++++++++++++++ User_Setup.h | 1 + 4 files changed, 28 insertions(+) diff --git a/TFT_Drivers/ST7735_Defines.h b/TFT_Drivers/ST7735_Defines.h index 35e9659..82a3c30 100644 --- a/TFT_Drivers/ST7735_Defines.h +++ b/TFT_Drivers/ST7735_Defines.h @@ -16,6 +16,7 @@ #define INITR_GREENTAB3 0x4 // Use if you get random pixels on edge(s) of 128x128 screen #define INITR_GREENTAB128 0x5 // Use if you only get part of 128x128 screen in rotation 0 & 1 #define INITR_GREENTAB160x80 0x6 // Use if you only get part of 128x128 screen in rotation 0 & 1 +#define INITR_REDTAB160x80 0x7 // Added for https://www.aliexpress.com/item/ShengYang-1pcs-IPS-0-96-inch-7P-SPI-HD-65K-Full-Color-OLED-Module-ST7735-Drive/32918394604.html #define INITB 0xB @@ -42,6 +43,10 @@ #elif defined (ST7735_GREENTAB160x80) #define TAB_COLOUR INITR_GREENTAB160x80 #define CGRAM_OFFSET + +#elif defined (ST7735_REDTAB160x80) + #define TAB_COLOUR INITR_REDTAB160x80 + #define CGRAM_OFFSET #elif defined (ST7735_REDTAB) #define TAB_COLOUR INITR_REDTAB diff --git a/TFT_Drivers/ST7735_Init.h b/TFT_Drivers/ST7735_Init.h index 3eef1d9..a528785 100644 --- a/TFT_Drivers/ST7735_Init.h +++ b/TFT_Drivers/ST7735_Init.h @@ -180,6 +180,12 @@ colstart = 26; rowstart = 1; } + else if (tabcolor == INITR_REDTAB160x80) + { + commandList(Rcmd2green); + colstart = 24; + rowstart = 0; + } else if (tabcolor == INITR_REDTAB) { commandList(Rcmd2red); diff --git a/TFT_Drivers/ST7735_Rotation.h b/TFT_Drivers/ST7735_Rotation.h index 89701f7..fba6419 100644 --- a/TFT_Drivers/ST7735_Rotation.h +++ b/TFT_Drivers/ST7735_Rotation.h @@ -24,6 +24,10 @@ writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_BGR); colstart = 26; rowstart = 1; + } else if(tabcolor == INITR_REDTAB160x80) { + writedata(TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_MH | TFT_MAD_BGR); + colstart = 24; + rowstart = 0; } else if(tabcolor == INITB) { writedata(TFT_MAD_MX | TFT_MAD_RGB); } else { @@ -51,6 +55,10 @@ writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR); colstart = 1; rowstart = 26; + } else if(tabcolor == INITR_REDTAB160x80) { + writedata(TFT_MAD_MV | TFT_MAD_MY | TFT_MAD_BGR); + colstart = 0; + rowstart = 24; } else if(tabcolor == INITB) { writedata(TFT_MAD_MV | TFT_MAD_MX | TFT_MAD_MY | TFT_MAD_RGB); } else { @@ -78,6 +86,10 @@ writedata(TFT_MAD_BGR); colstart = 0; rowstart = 0; + } else if(tabcolor == INITR_REDTAB160x80) { + writedata(TFT_MAD_BGR); + colstart = 0; + rowstart = 0; } else if(tabcolor == INITB) { writedata(TFT_MAD_MY | TFT_MAD_RGB); } else { @@ -105,6 +117,10 @@ writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR); colstart = 1; rowstart = 26; + } else if(tabcolor == INITR_REDTAB160x80) { + writedata(TFT_MAD_MX | TFT_MAD_MV | TFT_MAD_BGR); + colstart = 0; + rowstart = 24; } else if(tabcolor == INITB) { writedata(TFT_MAD_MV | TFT_MAD_RGB); } else { diff --git a/User_Setup.h b/User_Setup.h index dd3d42a..9b2359c 100644 --- a/User_Setup.h +++ b/User_Setup.h @@ -53,6 +53,7 @@ // #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset) // #define ST7735_REDTAB // #define ST7735_BLACKTAB +// #define ST7735_REDTAB160x80 // For 160 x 80 display (24 offset) (https://www.aliexpress.com/item/ShengYang-1pcs-IPS-0-96-inch-7P-SPI-HD-65K-Full-Color-OLED-Module-ST7735-Drive/32918394604.html) // ################################################################################## // From 8d3a4d09bd77313f5f191726b6feef6f23cc658a Mon Sep 17 00:00:00 2001 From: Gavin Smalley Date: Wed, 7 Nov 2018 15:29:29 +0000 Subject: [PATCH 2/3] Correct rotation 2 for red-tabbed 80x160 screen. --- TFT_Drivers/ST7735_Rotation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TFT_Drivers/ST7735_Rotation.h b/TFT_Drivers/ST7735_Rotation.h index fba6419..6163abb 100644 --- a/TFT_Drivers/ST7735_Rotation.h +++ b/TFT_Drivers/ST7735_Rotation.h @@ -88,7 +88,7 @@ rowstart = 0; } else if(tabcolor == INITR_REDTAB160x80) { writedata(TFT_MAD_BGR); - colstart = 0; + colstart = 24; rowstart = 0; } else if(tabcolor == INITB) { writedata(TFT_MAD_MY | TFT_MAD_RGB); From 2aeb09db38d0ff6ddd9e56c6b87d9de96130dde3 Mon Sep 17 00:00:00 2001 From: Gavin Smalley Date: Thu, 8 Nov 2018 10:32:40 +0000 Subject: [PATCH 3/3] Bump version and add option for red-tabbed 160x80 screen support to SetupX_Template.h --- User_Setups/SetupX_Template.h | 1 + library.json | 2 +- library.properties | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/User_Setups/SetupX_Template.h b/User_Setups/SetupX_Template.h index dd3d42a..9b2359c 100644 --- a/User_Setups/SetupX_Template.h +++ b/User_Setups/SetupX_Template.h @@ -53,6 +53,7 @@ // #define ST7735_GREENTAB160x80 // For 160 x 80 display (BGR, inverted, 26 offset) // #define ST7735_REDTAB // #define ST7735_BLACKTAB +// #define ST7735_REDTAB160x80 // For 160 x 80 display (24 offset) (https://www.aliexpress.com/item/ShengYang-1pcs-IPS-0-96-inch-7P-SPI-HD-65K-Full-Color-OLED-Module-ST7735-Drive/32918394604.html) // ################################################################################## // diff --git a/library.json b/library.json index 70c37a9..496bd2e 100644 --- a/library.json +++ b/library.json @@ -1,6 +1,6 @@ { "name": "TFT_eSPI", - "version": "1.1.3", + "version": "1.1.4", "keywords": "tft, ePaper, display, ESP8266, NodeMCU, ESP32, M5Stack, ILI9341, ST7735, ILI9163, S6D02A1, ILI9486, ST7789", "description": "A TFT and ePaper SPI graphics library for ESP8266 and ESP32", "repository": diff --git a/library.properties b/library.properties index ac3cd85..fd62f0e 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=TFT_eSPI -version=1.1.3 +version=1.1.4 author=Bodmer maintainer=Bodmer sentence=A fast TFT graphics library for ESP8266 and ESP32 processors for the Arduino IDE