Add invert_colors option for st7735 (#2327)

This commit is contained in:
Aljaž Srebrnič
2021-09-20 10:08:08 +02:00
committed by GitHub
parent 5e345783bd
commit 3052c64dd7
3 changed files with 12 additions and 2 deletions
+3 -1
View File
@@ -37,7 +37,8 @@ class ST7735 : public PollingComponent,
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
spi::DATA_RATE_8MHZ> {
public:
ST7735(ST7735Model model, int width, int height, int colstart, int rowstart, bool eightbitcolor, bool usebgr);
ST7735(ST7735Model model, int width, int height, int colstart, int rowstart, bool eightbitcolor, bool usebgr,
bool invert_colors);
void dump_config() override;
void setup() override;
@@ -77,6 +78,7 @@ class ST7735 : public PollingComponent,
uint8_t colstart_ = 0, rowstart_ = 0;
bool eightbitcolor_ = false;
bool usebgr_ = false;
bool invert_colors_ = false;
int16_t width_ = 80, height_ = 80; // Watch heap size
GPIOPin *reset_pin_{nullptr};