|
| 1 | +#ifndef _THINKINK_290_TRICOLOR_Z94_H |
| 2 | +#define _THINKINK_290_TRICOLOR_Z94_H |
| 3 | + |
| 4 | +// This file is #included by Adafruit_ThinkInk.h and does not need to |
| 5 | +// #include anything else to pick up the EPD header or ink mode enum. |
| 6 | + |
| 7 | +class ThinkInk_290_Tricolor_Z94 : public Adafruit_SSD1680 { |
| 8 | +public: |
| 9 | + ThinkInk_290_Tricolor_Z94(int8_t SID, int8_t SCLK, int8_t DC, int8_t RST, |
| 10 | + int8_t CS, int8_t SRCS, int8_t MISO, |
| 11 | + int8_t BUSY = -1) |
| 12 | + : Adafruit_SSD1680(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){}; |
| 13 | + |
| 14 | + ThinkInk_290_Tricolor_Z94(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS, |
| 15 | + int8_t BUSY = -1, SPIClass *spi = &SPI) |
| 16 | + : Adafruit_SSD1680(296, 128, DC, RST, CS, SRCS, BUSY, spi){}; |
| 17 | + |
| 18 | + void begin(thinkinkmode_t mode = THINKINK_TRICOLOR) { |
| 19 | + _xram_offset = 0; |
| 20 | + |
| 21 | + Adafruit_SSD1680::begin(true); |
| 22 | + setBlackBuffer(0, true); |
| 23 | + setColorBuffer(1, false); |
| 24 | + |
| 25 | + inkmode = mode; // Preserve ink mode for ImageReader or others |
| 26 | + |
| 27 | + layer_colors[EPD_WHITE] = 0b00; |
| 28 | + layer_colors[EPD_BLACK] = 0b01; |
| 29 | + layer_colors[EPD_RED] = 0b10; |
| 30 | + layer_colors[EPD_GRAY] = 0b10; |
| 31 | + layer_colors[EPD_LIGHT] = 0b00; |
| 32 | + layer_colors[EPD_DARK] = 0b01; |
| 33 | + |
| 34 | + default_refresh_delay = 13000; |
| 35 | + setRotation(0); |
| 36 | + powerDown(); |
| 37 | + } |
| 38 | +}; |
| 39 | + |
| 40 | +#endif // _THINKINK_290 Z94 |
0 commit comments