diff --git a/Adafruit_ST7735.cpp b/Adafruit_ST7735.cpp index bfab90a..04262c9 100644 --- a/Adafruit_ST7735.cpp +++ b/Adafruit_ST7735.cpp @@ -234,6 +234,12 @@ void Adafruit_ST7735::initR(uint8_t options) { displayInit(Rcmd2green160x80); _colstart = 24; _rowstart = 0; + } else if (options == INITR_GREENTAB160x80) { + _height = ST7735_TFTWIDTH_80; + _width = ST7735_TFTHEIGHT_160; + displayInit(Rcmd2green160x80); + _colstart = 26; + _rowstart = 1; } else { // colstart, rowstart left at default '0' values displayInit(Rcmd2red); @@ -246,6 +252,10 @@ void Adafruit_ST7735::initR(uint8_t options) { sendCommand(ST77XX_MADCTL, &data, 1); } + if (options == INITR_GREENTAB160x80) { + sendCommand(ST77XX_INVON, 0); + } + if (options == INITR_HALLOWING) { // Hallowing is simply a 1.44" green tab upside-down: tabcolor = INITR_144GREENTAB; @@ -286,7 +296,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) { if (tabcolor == INITR_144GREENTAB) { _height = ST7735_TFTHEIGHT_128; _width = ST7735_TFTWIDTH_128; - } else if (tabcolor == INITR_MINI160x80) { + } else if ((tabcolor == INITR_MINI160x80) || + (tabcolor == INITR_GREENTAB160x80)) { _height = ST7735_TFTHEIGHT_160; _width = ST7735_TFTWIDTH_80; } else { @@ -306,7 +317,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) { if (tabcolor == INITR_144GREENTAB) { _width = ST7735_TFTHEIGHT_128; _height = ST7735_TFTWIDTH_128; - } else if (tabcolor == INITR_MINI160x80) { + } else if ((tabcolor == INITR_MINI160x80) || + (tabcolor == INITR_GREENTAB160x80)) { _width = ST7735_TFTHEIGHT_160; _height = ST7735_TFTWIDTH_80; } else { @@ -326,7 +338,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) { if (tabcolor == INITR_144GREENTAB) { _height = ST7735_TFTHEIGHT_128; _width = ST7735_TFTWIDTH_128; - } else if (tabcolor == INITR_MINI160x80) { + } else if ((tabcolor == INITR_MINI160x80) || + (tabcolor == INITR_GREENTAB160x80)) { _height = ST7735_TFTHEIGHT_160; _width = ST7735_TFTWIDTH_80; } else { @@ -346,7 +359,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) { if (tabcolor == INITR_144GREENTAB) { _width = ST7735_TFTHEIGHT_128; _height = ST7735_TFTWIDTH_128; - } else if (tabcolor == INITR_MINI160x80) { + } else if ((tabcolor == INITR_MINI160x80) || + (tabcolor == INITR_GREENTAB160x80)) { _width = ST7735_TFTHEIGHT_160; _height = ST7735_TFTWIDTH_80; } else { diff --git a/Adafruit_ST7735.h b/Adafruit_ST7735.h index da1320a..6d138bc 100755 --- a/Adafruit_ST7735.h +++ b/Adafruit_ST7735.h @@ -13,6 +13,7 @@ #define INITR_144GREENTAB 0x01 #define INITR_MINI160x80 0x04 #define INITR_HALLOWING 0x05 +#define INITR_GREENTAB160x80 0x06 // Some register settings #define ST7735_MADCTL_BGR 0x08