From 759fbb7cb1b52fed96f11e8ee15ae549eb5fdacf Mon Sep 17 00:00:00 2001 From: jcvar <61365224+jcvar@users.noreply.github.com> Date: Sat, 27 Jun 2020 23:07:45 -0500 Subject: [PATCH 1/2] Add access to init functions from TFT.cpp --- src/TFT.cpp | 10 ++++++++++ src/utility/Adafruit_ST7735.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/TFT.cpp b/src/TFT.cpp index bb6f197..c110de6 100644 --- a/src/TFT.cpp +++ b/src/TFT.cpp @@ -58,3 +58,13 @@ void TFT::begin() { initG(); setRotation(1); } + +void TFT::begin(uint8_t init_opt) { + if(init_opt == INIT_B) initB(); + else if (init_opt == INIT_G) initG(); + else if (init_opt == INITR_REDTAB) initR(INITR_REDTAB); + else if (init_opt == INITR_BLACKTAB) initR(INITR_BLACKTAB); + else if (init_opt == INITR_GREENTAB) initR(INITR_GREENTAB); + + setRotation(1); +} diff --git a/src/utility/Adafruit_ST7735.h b/src/utility/Adafruit_ST7735.h index fbbd6ab..896df36 100644 --- a/src/utility/Adafruit_ST7735.h +++ b/src/utility/Adafruit_ST7735.h @@ -33,6 +33,8 @@ #define INITR_GREENTAB 0x0 #define INITR_REDTAB 0x1 #define INITR_BLACKTAB 0x2 +#define INIT_B 0x3 +#define INIT_G 0x4 #define ST7735_TFTWIDTH 128 #define ST7735_TFTHEIGHT 160 From 410e6a01664d184004d8d3fb395f92ea9acf1bc7 Mon Sep 17 00:00:00 2001 From: jcvar <61365224+jcvar@users.noreply.github.com> Date: Mon, 29 Jun 2020 14:41:11 -0500 Subject: [PATCH 2/2] Add signature to header --- src/TFT.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/TFT.h b/src/TFT.h index 65157fb..b0a6413 100644 --- a/src/TFT.h +++ b/src/TFT.h @@ -48,6 +48,7 @@ class TFT : public Adafruit_ST7735 { TFT(uint8_t CS, uint8_t RS, uint8_t RST); void begin(); + void begin(uint8_t init_opt); }; /// Esplora boards have hard-wired connections with