Skip to content

Commit 3eeba91

Browse files
committed
reduce delay for T5, add 4.2"
1 parent 8754ebe commit 3eeba91

File tree

6 files changed

+46
-4
lines changed

6 files changed

+46
-4
lines changed

src/Adafruit_EPD.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@ void Adafruit_EPD::display(bool sleep) {
295295

296296
powerUp();
297297

298+
#ifdef EPD_DEBUG
299+
Serial.println(" Set RAM address");
300+
#endif
301+
298302
// Set X & Y ram counters
299303
setRAMAddress(0, 0);
300304

src/Adafruit_ThinkInk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ typedef enum {
99
#include "panels/ThinkInk_213_Tricolor_RW.h"
1010
#include "panels/ThinkInk_270_Tricolor_C44.h"
1111
#include "panels/ThinkInk_290_Tricolor_Z10.h"
12+
#include "panels/ThinkInk_420_Tricolor_RW.h"
1213

1314
#include "panels/ThinkInk_154_Grayscale4_T8.h"
1415
#include "panels/ThinkInk_213_Grayscale4_T5.h"

src/drivers/Adafruit_IL0373.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "Adafruit_IL0373.h"
22
#include "Adafruit_EPD.h"
33

4-
#define BUSY_WAIT 500
4+
#define BUSY_WAIT 100
55

66
// clang-format off
77

@@ -92,13 +92,15 @@ Adafruit_IL0373::Adafruit_IL0373(int width, int height, int8_t DC, int8_t RST,
9292
*/
9393
/**************************************************************************/
9494
void Adafruit_IL0373::busy_wait(void) {
95+
Serial.print("Waiting...");
9596
if (_busy_pin >= 0) {
9697
while (!digitalRead(_busy_pin)) {
9798
delay(10); // wait for busy high
9899
}
99100
} else {
100101
delay(BUSY_WAIT);
101102
}
103+
Serial.println("OK!");
102104
}
103105

104106
/**************************************************************************/

src/drivers/Adafruit_SSD1619.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ void Adafruit_SSD1619::update() {
141141
uint8_t buf[1];
142142

143143
// display update sequence
144-
buf[0] = 0x40;
145-
EPD_command(SSD1619_DISP_CTRL1, buf, 1);
144+
//buf[0] = 0x40;
145+
//EPD_command(SSD1619_DISP_CTRL1, buf, 1);
146146
buf[0] = 0xC7;
147147
EPD_command(SSD1619_DISP_CTRL2, buf, 1);
148148

src/panels/ThinkInk_290_Grayscale4_T5.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class ThinkInk_290_Grayscale4_T5 : public Adafruit_IL0373 {
185185
layer_colors[EPD_DARK] = 0b01;
186186
}
187187

188-
default_refresh_delay = 1000;
188+
default_refresh_delay = 800;
189189

190190
powerDown();
191191
};

src/panels/ThinkInk_420_Tricolor_RW.h

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

0 commit comments

Comments
 (0)