@@ -234,6 +234,12 @@ void Adafruit_ST7735::initR(uint8_t options) {
234234 displayInit (Rcmd2green160x80);
235235 _colstart = 24 ;
236236 _rowstart = 0 ;
237+ } else if (options == INITR_GREENTAB160x80) {
238+ _height = ST7735_TFTWIDTH_80;
239+ _width = ST7735_TFTHEIGHT_160;
240+ displayInit (Rcmd2green160x80);
241+ _colstart = 26 ;
242+ _rowstart = 1 ;
237243 } else {
238244 // colstart, rowstart left at default '0' values
239245 displayInit (Rcmd2red);
@@ -246,6 +252,10 @@ void Adafruit_ST7735::initR(uint8_t options) {
246252 sendCommand (ST77XX_MADCTL, &data, 1 );
247253 }
248254
255+ if (options == INITR_GREENTAB160x80) {
256+ sendCommand (ST77XX_INVON, 0 );
257+ }
258+
249259 if (options == INITR_HALLOWING) {
250260 // Hallowing is simply a 1.44" green tab upside-down:
251261 tabcolor = INITR_144GREENTAB;
@@ -286,7 +296,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
286296 if (tabcolor == INITR_144GREENTAB) {
287297 _height = ST7735_TFTHEIGHT_128;
288298 _width = ST7735_TFTWIDTH_128;
289- } else if (tabcolor == INITR_MINI160x80) {
299+ } else if ((tabcolor == INITR_MINI160x80) ||
300+ (tabcolor == INITR_GREENTAB160x80)) {
290301 _height = ST7735_TFTHEIGHT_160;
291302 _width = ST7735_TFTWIDTH_80;
292303 } else {
@@ -306,7 +317,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
306317 if (tabcolor == INITR_144GREENTAB) {
307318 _width = ST7735_TFTHEIGHT_128;
308319 _height = ST7735_TFTWIDTH_128;
309- } else if (tabcolor == INITR_MINI160x80) {
320+ } else if ((tabcolor == INITR_MINI160x80) ||
321+ (tabcolor == INITR_GREENTAB160x80)) {
310322 _width = ST7735_TFTHEIGHT_160;
311323 _height = ST7735_TFTWIDTH_80;
312324 } else {
@@ -326,7 +338,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
326338 if (tabcolor == INITR_144GREENTAB) {
327339 _height = ST7735_TFTHEIGHT_128;
328340 _width = ST7735_TFTWIDTH_128;
329- } else if (tabcolor == INITR_MINI160x80) {
341+ } else if ((tabcolor == INITR_MINI160x80) ||
342+ (tabcolor == INITR_GREENTAB160x80)) {
330343 _height = ST7735_TFTHEIGHT_160;
331344 _width = ST7735_TFTWIDTH_80;
332345 } else {
@@ -346,7 +359,8 @@ void Adafruit_ST7735::setRotation(uint8_t m) {
346359 if (tabcolor == INITR_144GREENTAB) {
347360 _width = ST7735_TFTHEIGHT_128;
348361 _height = ST7735_TFTWIDTH_128;
349- } else if (tabcolor == INITR_MINI160x80) {
362+ } else if ((tabcolor == INITR_MINI160x80) ||
363+ (tabcolor == INITR_GREENTAB160x80)) {
350364 _width = ST7735_TFTHEIGHT_160;
351365 _height = ST7735_TFTWIDTH_80;
352366 } else {
0 commit comments