Skip to content

Commit 18ae1e6

Browse files
committed
add 1.54" tricolor RW type panel, clarify tricolor demo pinout
1 parent 45b63d7 commit 18ae1e6

File tree

3 files changed

+46
-7
lines changed

3 files changed

+46
-7
lines changed

examples/ThinkInk_tricolor/ThinkInk_tricolor.ino

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@
99

1010
#include "Adafruit_ThinkInk.h"
1111

12-
#define EPD_CS 9
13-
#define EPD_DC 10
14-
#define SRAM_CS 6
15-
#define EPD_RESET 5 // can set to -1 and share with microcontroller Reset!
16-
#define EPD_BUSY 7 // can set to -1 to not use a pin (will wait a fixed delay)
12+
#define EPD_DC 10 // can be any pin, but required!
13+
#define EPD_CS 9 // can be any pin, but required!
14+
#define EPD_BUSY 7 // can set to -1 to not use a pin (will wait a fixed delay)
15+
#define SRAM_CS 6 // can set to -1 to not use a pin (uses a lot of RAM!)
16+
#define EPD_RESET 5 // can set to -1 and share with chip Reset (can't deep sleep)
1717

1818
//ThinkInk_154_Tricolor_Z17 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
19+
//ThinkInk_154_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
1920
//ThinkInk_213_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2021
//ThinkInk_213_Tricolor_Z16 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2122
//ThinkInk_270_Tricolor_C44 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
22-
//ThinkInk_290_Tricolor_Z10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
23-
ThinkInk_420_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
23+
// 2.9" Tricolor Featherwing or Breakout:
24+
ThinkInk_290_Tricolor_Z10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
25+
//ThinkInk_420_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2426

2527
void setup() {
2628
Serial.begin(115200);

src/Adafruit_ThinkInk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ typedef enum {
55
} thinkinkmode_t;
66

77
#include "panels/ThinkInk_154_Tricolor_Z17.h"
8+
#include "panels/ThinkInk_154_Tricolor_RW.h"
89
#include "panels/ThinkInk_213_Tricolor_RW.h"
910
#include "panels/ThinkInk_213_Tricolor_Z16.h"
1011
#include "panels/ThinkInk_270_Tricolor_C44.h"

src/panels/ThinkInk_154_Tricolor_RW.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#ifndef _THINKINK_154_TRICOLOR_RW_H
2+
#define _THINKINK_154_TRICOLOR_RW_H
3+
4+
#include "Adafruit_EPD.h"
5+
6+
class ThinkInk_154_Tricolor_RW : public Adafruit_SSD1680 {
7+
private:
8+
public:
9+
ThinkInk_154_Tricolor_RW(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(250, 152, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
13+
14+
ThinkInk_154_Tricolor_RW(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
15+
int8_t BUSY = -1, SPIClass *spi = &SPI)
16+
: Adafruit_SSD1680(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
17+
18+
void begin(thinkinkmode_t mode = THINKINK_MONO) {
19+
Adafruit_EPD::begin(true);
20+
setBlackBuffer(0, true);
21+
setColorBuffer(1, false);
22+
23+
layer_colors[EPD_WHITE] = 0b00;
24+
layer_colors[EPD_BLACK] = 0b01;
25+
layer_colors[EPD_RED] = 0b10;
26+
layer_colors[EPD_GRAY] = 0b10;
27+
layer_colors[EPD_LIGHT] = 0b00;
28+
layer_colors[EPD_DARK] = 0b01;
29+
30+
default_refresh_delay = 13000;
31+
setRotation(3);
32+
powerDown();
33+
};
34+
};
35+
36+
#endif // _THINKINK_154_TRI

0 commit comments

Comments
 (0)