Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/TFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
1 change: 1 addition & 0 deletions src/TFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/utility/Adafruit_ST7735.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down