|
3 | 3 |
|
4 | 4 | #include "Adafruit_EPD.h"
|
5 | 5 |
|
| 6 | +// clang-format off |
| 7 | + |
| 8 | +static const uint8_t ti_270w3_gray4_init_code[] { |
| 9 | + IL91874_POWER_SETTING, 4, 0x03, 0x00, 0x2b, 0x2b, |
| 10 | + IL91874_BOOSTER_SOFT_START, 3, 0x07, 0x07, 0x17, |
| 11 | + 0xF8, 2, 0x60, 0xA5, // boost |
| 12 | + 0xF8, 2, 0x89, 0xA5, // boost |
| 13 | + 0xF8, 2, 0x90, 0x00, // boost |
| 14 | + 0xF8, 2, 0x93, 0x2A, // boost |
| 15 | + 0xF8, 2, 0xA0, 0xA5, // boost |
| 16 | + 0xF8, 2, 0xA1, 0x00, // boost |
| 17 | + 0xF8, 2, 0x73, 0x41, // boost |
| 18 | + IL91874_PDRF, 1, 0x00, |
| 19 | + IL91874_POWER_ON, 0, |
| 20 | + 0xFF, 200, |
| 21 | + IL91874_PANEL_SETTING, 1, 0xBF, |
| 22 | + IL91874_PLL, 1, 0x90, |
| 23 | + IL91874_VCM_DC_SETTING, 1, 0x12, |
| 24 | + IL91874_CDI, 1, 0x97, |
| 25 | + 0xFE // EOM |
| 26 | +}; |
| 27 | + |
| 28 | + |
| 29 | +static const uint8_t ti_270w3_gray4_lut_code[] = { |
| 30 | + // const unsigned char lut_vcom[]PROGMEM = |
| 31 | + IL91874_LUT1, 44, |
| 32 | + 0x00, 0x00, |
| 33 | + 0x00 , 0x0A, 0x00, 0x00, 0x00, 0x01, |
| 34 | + 0x60, 0x14, 0x14, 0x00, 0x00, 0x01, |
| 35 | + 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, |
| 36 | + 0x00, 0x13, 0x0A, 0x01, 0x00, 0x01, |
| 37 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 38 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 39 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 40 | + |
| 41 | + // const unsigned char lut_ww[]PROGMEM ={ |
| 42 | + IL91874_LUTWW, 42, |
| 43 | + 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01, |
| 44 | + 0x90, 0x14, 0x14, 0x00, 0x00, 0x01, |
| 45 | + 0x10, 0x14, 0x0A, 0x00, 0x00, 0x01, |
| 46 | + 0xA0, 0x13, 0x01, 0x00, 0x00, 0x01, |
| 47 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 48 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 49 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 50 | + |
| 51 | + // const unsigned char lut_bw[]PROGMEM ={ |
| 52 | + IL91874_LUTBW, 42, |
| 53 | + 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01, |
| 54 | + 0x90, 0x14, 0x14, 0x00, 0x00, 0x01, |
| 55 | + 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01, |
| 56 | + 0x99, 0x0C, 0x01, 0x03, 0x04, 0x01, |
| 57 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 58 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 59 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 60 | + |
| 61 | + // const unsigned char lut_wb[]PROGMEM ={ |
| 62 | + IL91874_LUTWB, 42, |
| 63 | + 0x40, 0x0A, 0x00, 0x00, 0x00, 0x01, |
| 64 | + 0x90, 0x14, 0x14, 0x00, 0x00, 0x01, |
| 65 | + 0x00, 0x14, 0x0A, 0x00, 0x00, 0x01, |
| 66 | + 0x99, 0x0B, 0x04, 0x04, 0x01, 0x01, |
| 67 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 68 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 69 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 70 | + |
| 71 | + // const unsigned char lut_bb[]PROGMEM ={ |
| 72 | + IL91874_LUTBB, 42, |
| 73 | + 0x80, 0x0A, 0x00, 0x00, 0x00, 0x01, |
| 74 | + 0x90, 0x14, 0x14, 0x00, 0x00, 0x01, |
| 75 | + 0x20, 0x14, 0x0A, 0x00, 0x00, 0x01, |
| 76 | + 0x50, 0x13, 0x01, 0x00, 0x00, 0x01, |
| 77 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 78 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 79 | + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 80 | +}; |
| 81 | + |
| 82 | +// clang-format on |
| 83 | + |
6 | 84 | class ThinkInk_270_Grayscale4_W3 : public Adafruit_IL91874 {
|
7 | 85 | private:
|
8 | 86 | public:
|
@@ -31,6 +109,16 @@ class ThinkInk_270_Grayscale4_W3 : public Adafruit_IL91874 {
|
31 | 109 | layer_colors[EPD_LIGHT] = 0b00;
|
32 | 110 | layer_colors[EPD_DARK] = 0b10;
|
33 | 111 | }
|
| 112 | + if (mode == THINKINK_GRAYSCALE4) { |
| 113 | + _epd_init_code = ti_270w3_gray4_init_code; |
| 114 | + _epd_lut_code = ti_270w3_gray4_lut_code; |
| 115 | + layer_colors[EPD_WHITE] = 0b00; |
| 116 | + layer_colors[EPD_BLACK] = 0b11; |
| 117 | + layer_colors[EPD_RED] = 0b10; |
| 118 | + layer_colors[EPD_GRAY] = 0b10; |
| 119 | + layer_colors[EPD_LIGHT] = 0b10; |
| 120 | + layer_colors[EPD_DARK] = 0b01; |
| 121 | + } |
34 | 122 |
|
35 | 123 | default_refresh_delay = 1000;
|
36 | 124 | powerDown();
|
|
0 commit comments