Skip to content

Commit 889f14f

Browse files
committed
fix busy polarity, add 2.9" panel
1 parent cfc915f commit 889f14f

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

src/Adafruit_ThinkInk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ typedef enum {
2626
#include "panels/ThinkInk_213_Mono_B72.h"
2727
#include "panels/ThinkInk_213_Mono_B73.h"
2828
#include "panels/ThinkInk_213_Mono_BN.h"
29+
#include "panels/ThinkInk_290_Mono_M06.h"
2930
#include "panels/ThinkInk_420_Mono_BN.h"
3031

3132
#endif // _ADAFRUIT_THINKINK_H_

src/drivers/Adafruit_UC8151D.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void Adafruit_UC8151D::busy_wait(void) {
103103
if (_busy_pin >= 0) {
104104
EPD_command(UC8151D_FLG);
105105

106-
if (! digitalRead(_busy_pin)) { // wait for busy high
106+
if (digitalRead(_busy_pin)) {
107107
delay(10);
108108
}
109109
} else {

src/panels/ThinkInk_290_Mono_M06.h

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#ifndef _THINKINK_290_MONO_M06_H
2+
#define _THINKINK_290_MONO_M06_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_Mono_M06 : public Adafruit_UC8151D {
8+
public:
9+
ThinkInk_290_Mono_M06(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_UC8151D(296, 128, SID, SCLK, DC, RST, CS, SRCS, MISO, BUSY){};
12+
13+
ThinkInk_290_Mono_M06(int8_t DC, int8_t RST, int8_t CS, int8_t SRCS,
14+
int8_t BUSY = -1, SPIClass *spi = &SPI)
15+
: Adafruit_UC8151D(296, 128, DC, RST, CS, SRCS, BUSY, spi){};
16+
17+
void begin(thinkinkmode_t mode = THINKINK_MONO) {
18+
Adafruit_EPD::begin(true);
19+
setColorBuffer(1, true); // layer 1 uninverted
20+
setBlackBuffer(1, true); // only one buffer
21+
22+
inkmode = mode; // Preserve ink mode for ImageReader or others
23+
24+
layer_colors[EPD_WHITE] = 0b00;
25+
layer_colors[EPD_BLACK] = 0b01;
26+
layer_colors[EPD_RED] = 0b01;
27+
layer_colors[EPD_GRAY] = 0b01;
28+
layer_colors[EPD_LIGHT] = 0b00;
29+
layer_colors[EPD_DARK] = 0b01;
30+
31+
default_refresh_delay = 1000;
32+
setRotation(0);
33+
powerDown();
34+
}
35+
36+
thinkinkmode_t getMode(void) { return inkmode; }
37+
38+
private:
39+
thinkinkmode_t inkmode; // Ink mode passed to begin()
40+
};
41+
42+
#endif // _THINKINK_290_MONO_M06_H

0 commit comments

Comments
 (0)