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/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 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