Skip to content

Commit a7c5335

Browse files
authored
Merge pull request #40 from adafruit/fix_bufferlayers
Fix bufferlayers
2 parents 2354334 + 117d2ef commit a7c5335

27 files changed

+169
-124
lines changed

examples/EPDTest/EPDTest.ino

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,41 @@
1616
#define EPD_RESET 5 // can set to -1 and share with microcontroller Reset!
1717
#define EPD_BUSY 7 // can set to -1 to not use a pin (will wait a fixed delay)
1818

19-
/* Uncomment the following line if you are using 1.54" tricolor EPD */
19+
// Uncomment the following line if you are using 1.54" EPD with IL0373
2020
//Adafruit_IL0373 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
21-
22-
/* Uncomment the following line if you are using 1.54" monochrome EPD */
21+
// Uncomment the following line if you are using 1.54" EPD with SSD1680
22+
//Adafruit_SSD1680 display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
23+
// Uncomment the following line if you are using 1.54" EPD with SSD1608
2324
//Adafruit_SSD1608 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
25+
// Uncomment the following line if you are using 1.54" EPD with SSD1681
26+
//Adafruit_SSD1681 display(200, 200, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
27+
// Uncomment the following line if you are using 1.54" EPD with UC8151D
28+
Adafruit_UC8151D display(152, 152, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2429

25-
/* Uncomment the following line if you are using 2.13" tricolor EPD */
26-
Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
27-
//#define FLEXIBLE_213
2830

29-
/* Uncomment the following line if you are using 2.13" monochrome 250*122 EPD */
31+
//Uncomment the following line if you are using 2.13" EPD with SSD1680
32+
//Adafruit_SSD1680 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
33+
34+
// Uncomment the following line if you are using 2.13" EPD with SSD1675
3035
//Adafruit_SSD1675 display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
3136

37+
// Uncomment the following line if you are using 2.13" EPD with SSD1675B
38+
//Adafruit_SSD1675B display(250, 122, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
39+
40+
// Uncomment the following line if you are using 2.13" EPD with UC8151D
41+
//Adafruit_UC8151D display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
42+
43+
//Uncomment the following line if you are using 2.13" EPD with IL0373
44+
//Adafruit_IL0373 display(212, 104, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
45+
//#define FLEXIBLE_213
46+
47+
3248
/* Uncomment the following line if you are using 2.7" tricolor or grayscale EPD */
3349
//Adafruit_IL91874 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
3450

51+
// 2.7" tricolor with Adafruit_EK79686
52+
//Adafruit_EK79686 display(264, 176, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS);
53+
3554
/* Uncomment the following line if you are using 2.9" EPD */
3655
//Adafruit_IL0373 display(296, 128, EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
3756
//#define FLEXIBLE_290

examples/ThinkInk_mono/ThinkInk_mono.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@
1515
#define EPD_RESET 8 // can set to -1 and share with microcontroller Reset!
1616
#define EPD_BUSY 7 // can set to -1 to not use a pin (will wait a fixed delay)
1717

18+
// 1.54" Monochrome displays with 200x200 pixels and SSD1681 chipset
1819
//ThinkInk_154_Mono_D67 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
20+
21+
// 1.54" Monochrome displays with 200x200 pixels and SSD1608 chipset
1922
//ThinkInk_154_Mono_D27 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2023

2124
// 1.54" Monochrome displays with 152x152 pixels and UC8151D chipset
2225
//ThinkInk_154_Mono_M10 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2326

27+
2428
// 2.13" Monochrome displays with 250x122 pixels and SSD1675 chipset
2529
ThinkInk_213_Mono_B72 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2630

@@ -33,6 +37,7 @@ ThinkInk_213_Mono_B72 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
3337
// 2.13" Monochrome displays with 212x104 pixels and UC8151D chipset
3438
//ThinkInk_213_Mono_M21 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
3539

40+
3641
// 2.9" 4-level Grayscale (use mono) displays with 296x128 pixels and IL0373 chipset
3742
//ThinkInk_290_Grayscale4_T5 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
3843

examples/ThinkInk_tricolor/ThinkInk_tricolor.ino

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@
1515
#define SRAM_CS 6 // can set to -1 to not use a pin (uses a lot of RAM!)
1616
#define EPD_RESET 8 // can set to -1 and share with chip Reset (can't deep sleep)
1717

18+
// 1.54" Tricolor EPD with SSD1680 chipset
1819
//ThinkInk_154_Tricolor_Z17 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
20+
21+
// 1.54" Tricolor EPD with SSD1680 chipset
1922
//ThinkInk_154_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
23+
24+
// 2.13" Tricolor EPD with SSD1680 chipset
2025
//ThinkInk_213_Tricolor_RW display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
26+
27+
// 2.13" Tricolor EPD with IL0373 chipset
2128
//ThinkInk_213_Tricolor_Z16 display(EPD_DC, EPD_RESET, EPD_CS, SRAM_CS, EPD_BUSY);
2229

2330
// 2.7" Tricolor Featherwing or Breakout with IL91874 chipset

src/Adafruit_ThinkInk.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@
99
#include "panels/ThinkInk_213_Tricolor_Z16.h"
1010
#include "panels/ThinkInk_270_Tricolor_C44.h"
1111
#include "panels/ThinkInk_270_Tricolor_Z70.h"
12+
#include "panels/ThinkInk_290_Tricolor_RH.h"
1213
#include "panels/ThinkInk_290_Tricolor_Z10.h"
1314
#include "panels/ThinkInk_420_Tricolor_RW.h"
1415

1516
#include "panels/ThinkInk_154_Grayscale4_T8.h"
1617
#include "panels/ThinkInk_213_Grayscale4_T5.h"
18+
#include "panels/ThinkInk_270_Grayscale4_W3.h"
1719
#include "panels/ThinkInk_290_Grayscale4_T5.h"
1820

1921
#include "panels/ThinkInk_154_Mono_D27.h"
@@ -23,6 +25,7 @@
2325
#include "panels/ThinkInk_213_Mono_B73.h"
2426
#include "panels/ThinkInk_213_Mono_BN.h"
2527
#include "panels/ThinkInk_213_Mono_M21.h"
28+
#include "panels/ThinkInk_290_Mono_BN.h"
2629
#include "panels/ThinkInk_290_Mono_M06.h"
2730
#include "panels/ThinkInk_420_Mono_BN.h"
2831

src/drivers/Adafruit_EK79686.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ void Adafruit_EK79686::busy_wait(void) {
125125
/**************************************************************************/
126126
void Adafruit_EK79686::begin(bool reset) {
127127
Adafruit_EPD::begin(reset);
128-
setBlackBuffer(1, true); // black defaults to inverted
129-
setColorBuffer(0, false); // red defaults to not-inverted
128+
setBlackBuffer(0, true); // black defaults to inverted
129+
setColorBuffer(1, false); // red defaults to not-inverted
130130

131131
powerDown();
132132
}

src/panels/ThinkInk_154_Grayscale4_T8.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class ThinkInk_154_Grayscale4_T8 : public Adafruit_IL0373 {
158158
: Adafruit_IL0373(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
159159

160160
void begin(thinkinkmode_t mode = THINKINK_GRAYSCALE4) {
161-
Adafruit_EPD::begin(true);
161+
Adafruit_IL0373::begin(true);
162162
setColorBuffer(0, true); // layer 0 uninverted
163163
setBlackBuffer(1, true); // layer 1 uninverted
164164

@@ -191,11 +191,6 @@ class ThinkInk_154_Grayscale4_T8 : public Adafruit_IL0373 {
191191
setRotation(3);
192192
powerDown();
193193
}
194-
195-
thinkinkmode_t getMode(void) { return inkmode; }
196-
197-
private:
198-
thinkinkmode_t inkmode; // Ink mode passed to begin()
199194
};
200195

201196
#endif // _THINKINK_154_GRAYSCALE4_T8_H

src/panels/ThinkInk_154_Mono_D27.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ThinkInk_154_Mono_D27 : public Adafruit_SSD1608 {
1515
: Adafruit_SSD1608(200, 200, DC, RST, CS, SRCS, BUSY, spi){};
1616

1717
void begin(thinkinkmode_t mode = THINKINK_MONO) {
18-
Adafruit_EPD::begin(true);
18+
Adafruit_SSD1608::begin(true);
1919
setColorBuffer(0, true); // layer 0 uninverted
2020
setBlackBuffer(0, true); // only one buffer
2121

@@ -32,11 +32,6 @@ class ThinkInk_154_Mono_D27 : public Adafruit_SSD1608 {
3232
setRotation(3);
3333
powerDown();
3434
}
35-
36-
thinkinkmode_t getMode(void) { return inkmode; }
37-
38-
private:
39-
thinkinkmode_t inkmode; // Ink mode passed to begin()
4035
};
4136

4237
#endif // _THINKINK_154_MONO_D27_H

src/panels/ThinkInk_154_Mono_D67.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ThinkInk_154_Mono_D67 : public Adafruit_SSD1681 {
1515
: Adafruit_SSD1681(200, 200, DC, RST, CS, SRCS, BUSY, spi){};
1616

1717
void begin(thinkinkmode_t mode = THINKINK_MONO) {
18-
Adafruit_EPD::begin(true);
18+
Adafruit_SSD1681::begin(true);
1919
setColorBuffer(0, true); // layer 0 uninverted
2020
setBlackBuffer(0, true); // only one buffer
2121

@@ -32,11 +32,6 @@ class ThinkInk_154_Mono_D67 : public Adafruit_SSD1681 {
3232
setRotation(3);
3333
powerDown();
3434
}
35-
36-
thinkinkmode_t getMode(void) { return inkmode; }
37-
38-
private:
39-
thinkinkmode_t inkmode; // Ink mode passed to begin()
4035
};
4136

4237
#endif // _THINKINK_154_MONO_D67_H

src/panels/ThinkInk_154_Mono_M10.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ThinkInk_154_Mono_M10 : public Adafruit_UC8151D {
1515
: Adafruit_UC8151D(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
1616

1717
void begin(thinkinkmode_t mode = THINKINK_MONO) {
18-
Adafruit_EPD::begin(true);
18+
Adafruit_UC8151D::begin(true);
1919
setColorBuffer(1, true); // layer 1 uninverted
2020
setBlackBuffer(1, true); // only one buffer
2121

@@ -32,11 +32,6 @@ class ThinkInk_154_Mono_M10 : public Adafruit_UC8151D {
3232
setRotation(1);
3333
powerDown();
3434
}
35-
36-
thinkinkmode_t getMode(void) { return inkmode; }
37-
38-
private:
39-
thinkinkmode_t inkmode; // Ink mode passed to begin()
4035
};
4136

4237
#endif // _THINKINK_154_MONO_M10_H

src/panels/ThinkInk_154_Tricolor_RW.h

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@ class ThinkInk_154_Tricolor_RW : public Adafruit_SSD1680 {
1616
: Adafruit_SSD1680(152, 152, DC, RST, CS, SRCS, BUSY, spi){};
1717

1818
void begin(thinkinkmode_t mode = THINKINK_MONO) {
19-
Adafruit_EPD::begin(true);
20-
setBlackBuffer(0, true);
21-
setColorBuffer(1, false);
19+
Adafruit_SSD1680::begin(true);
2220

2321
inkmode = mode; // Preserve ink mode for ImageReader or others
2422

@@ -33,11 +31,6 @@ class ThinkInk_154_Tricolor_RW : public Adafruit_SSD1680 {
3331
setRotation(3);
3432
powerDown();
3533
}
36-
37-
thinkinkmode_t getMode(void) { return inkmode; }
38-
39-
private:
40-
thinkinkmode_t inkmode; // Ink mode passed to begin()
4134
};
4235

4336
#endif // _THINKINK_154_TRI

0 commit comments

Comments
 (0)