Skip to content

Commit

Permalink
Version 1.2.10
Browse files Browse the repository at this point in the history
- added support for GDEH075Z90 7.5" b/w/r 880x528
- the controller of GDEH075Z90 supports partial update, but refesh is full screen
- the controller of GDEH075Z90 doesn't support differential update (not possible on 3-color anyway)
- note: the connector of  the GDEH075Z90 is mirrored; connects downward on DESPI-C02
- added optional init parameter "reset_duration" in ms, same default 20ms as before
- reset_duration = 2 may help with "clever" reset circuit of newer boards from Waveshare
  • Loading branch information
ZinggJM committed Jul 28, 2020
1 parent 37a8000 commit bde0026
Show file tree
Hide file tree
Showing 13 changed files with 7,860 additions and 16 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
- GDEW075T7 7.5" b/w 800x480
- GDEW075Z09 7.5" b/w/r
- GDEW075Z08 7.5" b/w/r 800x480
- GDEH075Z90 7.5" b/w/r 880x528
- GDEW1248T3 12.48 b/w 1304x984
#### Supported SPI e-paper panels & boards from Waveshare: compare with Good Display, same panel
#### other supported panels
Expand All @@ -84,7 +85,14 @@
- promotion panels from suppliers are welcome, to add support to GxEPD2
- donation panels from users are welcome, to add support to GxEPD2

### Version 1.2.9
### Version 1.2.10
- added support for GDEH075Z90 7.5" b/w/r 880x528
- the controller of GDEH075Z90 supports partial update, but refesh is full screen
- the controller of GDEH075Z90 doesn't support differential update (not possible on 3-color anyway)
- note: the connector of the GDEH075Z90 is mirrored; connects downward on DESPI-C02
- added optional init parameter "reset_duration" in ms, same default 20ms as before
- reset_duration = 2 may help with "clever" reset circuit of newer boards from Waveshare
#### Version 1.2.9
- added support for GDEW0154T8 1.54" b/w 152x152
- added support for GDEW0154M09 1.54" b/w 200x200
- added support for GDEW0154M10 1.54" b/w 152x152 DES
Expand Down
48 changes: 45 additions & 3 deletions examples/GxEPD2_Example/GxEPD2_Example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
//GxEPD2_3C < GxEPD2_583c, GxEPD2_583c::HEIGHT / 4 > display(GxEPD2_583c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
//GxEPD2_3C<GxEPD2_750c, GxEPD2_750c::HEIGHT / 4> display(GxEPD2_750c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
//GxEPD2_3C < GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT / 4 > display(GxEPD2_750c_Z08(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW075Z08 800x480
//GxEPD2_3C < GxEPD2_750c_Z90, GxEPD2_750c_Z90::HEIGHT / 4 > display(GxEPD2_750c_Z90(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH075Z90 880x528
// grey levels parallel IF e-papers on Waveshare e-Paper IT8951 Driver HAT
// HRDY -> 4, RST -> 2, CS -> SS(15), SCK -> SCK(14), MOSI -> MOSI(D7(13)), MISO -> MISO(D6(12)), GND -> GND, 5V -> 5V
// note: 5V supply needs to be exact and strong; 5V pin of USB powered Wemos D1 mini doesn't work!
Expand Down Expand Up @@ -132,6 +133,7 @@
//GxEPD2_3C<GxEPD2_583c, GxEPD2_583c::HEIGHT / 4> display(GxEPD2_583c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16));
//GxEPD2_3C<GxEPD2_750c, GxEPD2_750c::HEIGHT / 4> display(GxEPD2_750c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16));
//GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT / 4> display(GxEPD2_750c_Z08(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW075Z08 800x480
//GxEPD2_3C<GxEPD2_750c_Z90, GxEPD2_750c_Z90::HEIGHT / 4> display(GxEPD2_750c_Z90(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH075Z90 880x528
#endif

#if defined(ESP32)
Expand Down Expand Up @@ -164,6 +166,7 @@
//GxEPD2_3C<GxEPD2_583c, GxEPD2_583c::HEIGHT> display(GxEPD2_583c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
//GxEPD2_3C<GxEPD2_750c, GxEPD2_750c::HEIGHT> display(GxEPD2_750c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
//GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT> display(GxEPD2_750c_Z08(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW075Z08 800x480
//GxEPD2_3C<GxEPD2_750c_Z90, GxEPD2_750c_Z90::HEIGHT / 2> display(GxEPD2_750c_Z90(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH075Z90 880x528

// grey levels parallel IF e-papers on Waveshare e-Paper IT8951 Driver HAT
// HRDY -> 4, RST -> 16, CS -> SS(5), SCK -> SCK(18), MOSI -> MOSI(23), MISO -> MISO(19), GND -> GND, 5V -> 5V
Expand All @@ -177,7 +180,8 @@
// /*dc1=*/ 25, /*dc2=*/ 17, /*rst1=*/ 33, /*rst2=*/ 5, /*busy_m1=*/ 32, /*busy_s1=*/ 26, /*busy_m2=*/ 18, /*busy_s2=*/ 4));
#endif

#if defined(_BOARD_GENERIC_STM32F103C_H_)
// can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics)
#if defined(ARDUINO_ARCH_STM32)
#define MAX_DISPLAY_BUFFER_SIZE 15000ul // ~15k is a good compromise
#define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
// select one and adapt to your mapping
Expand Down Expand Up @@ -210,6 +214,7 @@
//GxEPD2_3C<GxEPD2_583c, MAX_HEIGHT_3C(GxEPD2_583c)> display(GxEPD2_583c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1));
//GxEPD2_3C<GxEPD2_750c, MAX_HEIGHT_3C(GxEPD2_750c)> display(GxEPD2_750c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1));
//GxEPD2_3C<GxEPD2_750c_Z08, MAX_HEIGHT_3C(GxEPD2_750c_Z08)> display(GxEPD2_750c_Z08(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW075Z08 800x480
//GxEPD2_3C<GxEPD2_750c_Z90, MAX_HEIGHT_3C(GxEPD2_750c_Z90)> display(GxEPD2_750c_Z90(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH075Z90 880x528
#endif

#if defined(__AVR)
Expand Down Expand Up @@ -249,6 +254,7 @@
//GxEPD2_3C<GxEPD2_583c, MAX_HEIGHT_3C(GxEPD2_583c)> display(GxEPD2_583c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_750c, MAX_HEIGHT_3C(GxEPD2_750c)> display(GxEPD2_750c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_750c_Z08, MAX_HEIGHT_3C(GxEPD2_750c_Z08)> display(GxEPD2_750c_Z08(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z08 800x480
//GxEPD2_3C<GxEPD2_750c_Z90, MAX_HEIGHT_3C(GxEPD2_750c_Z90)> display(GxEPD2_750c_Z90(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH075Z90 880x528

// ***** for mapping of Waveshare Universal e-Paper Raw Panel Driver Shield for Arduino / NUCLEO *****
// the RST line is not connected through level converter, but has a pull up resistor and a pull down diode to the Arduino pin; this is safe for 5V Arduino
Expand Down Expand Up @@ -285,6 +291,7 @@
//GxEPD2_3C<GxEPD2_583c, MAX_HEIGHT_3C(GxEPD2_583c)> display(GxEPD2_583c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_750c, MAX_HEIGHT_3C(GxEPD2_750c)> display(GxEPD2_750c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_750c_Z08, MAX_HEIGHT_3C(GxEPD2_750c_Z08)> display(GxEPD2_750c_Z08(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW075Z08 800x480
//GxEPD2_3C<GxEPD2_750c_Z90, MAX_HEIGHT_3C(GxEPD2_750c_Z90)> display(GxEPD2_750c_Z90(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); //GDEH075Z90 880x528

// Waveshare 12.48 b/w SPI display board and frame or Good Display 12.48 b/w panel GDEW1248T3
// general constructor for use with standard SPI pins, default SCK, MISO and MOSI, for UNO on UNO connectors
Expand Down Expand Up @@ -322,6 +329,7 @@
#include "bitmaps/Bitmaps3c400x300.h" // 4.2" b/w/r
#if defined(ESP8266) || defined(ESP32)
#include "bitmaps/Bitmaps3c800x480.h" // 7.5" b/w/r
#include "bitmaps/Bitmaps3c880x528.h" // 7.5" b/w/r
#include "bitmaps/WS_Bitmaps800x600.h" // 6.0" grey
#endif
#if defined(ESP32)
Expand Down Expand Up @@ -913,6 +921,9 @@ void drawBitmaps()
#endif
#ifdef _GxBitmaps3c800x480_H_
drawBitmaps3c800x480();
#endif
#ifdef _GxBitmaps3c880x528_H_
drawBitmaps3c880x528();
#endif
if ((display.epd2.WIDTH >= 200) && (display.epd2.HEIGHT >= 200))
{
Expand Down Expand Up @@ -971,10 +982,10 @@ void drawBitmaps200x200()
{
logo200x200, //first200x200
};
#elif defined(_BOARD_GENERIC_STM32F103C_H_)
#elif defined(_BOARD_GENERIC_STM32F103C_H_) || defined(STM32F1xx)
const unsigned char* bitmaps[] =
{
logo200x200, first200x200, second200x200, third200x200, fourth200x200, fifth200x200 //, sixth200x200, senventh200x200, eighth200x200
logo200x200, first200x200, second200x200, third200x200, //fourth200x200, fifth200x200, sixth200x200, senventh200x200, eighth200x200
};
#else
const unsigned char* bitmaps[] =
Expand Down Expand Up @@ -1643,3 +1654,34 @@ void drawBitmaps3c800x480()
}
}
#endif

#ifdef _GxBitmaps3c880x528_H_
void drawBitmaps3c880x528()
{
#if !defined(__AVR)
bitmap_pair bitmap_pairs[] =
{
{Bitmap3c880x528_black, Bitmap3c880x528_red}
};
#else
bitmap_pair bitmap_pairs[] = {}; // not enough code space
#endif
if (display.epd2.panel == GxEPD2::GDEH075Z90)
{
bool m = display.mirror(true);
for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
{
display.firstPage();
do
{
display.fillScreen(GxEPD_WHITE);
display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, 880, 528, GxEPD_BLACK);
display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, 880, 528, GxEPD_RED);
}
while (display.nextPage());
delay(2000);
}
display.mirror(m);
}
}
#endif
4 changes: 4 additions & 0 deletions examples/GxEPD2_Example/GxEPD2_boards_added.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
//GxEPD2_3C<GxEPD2_583c, MAX_HEIGHT_3C(GxEPD2_583c)> display(GxEPD2_583c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_750c, MAX_HEIGHT_3C(GxEPD2_750c)> display(GxEPD2_750c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_750c_Z08, MAX_HEIGHT_3C(GxEPD2_750c_Z08)> display(GxEPD2_750c_Z08(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW075Z08 800x480
//GxEPD2_3C<GxEPD2_750c_Z90, MAX_HEIGHT_3C(GxEPD2_750c_Z90)> display(GxEPD2_750c_Z90(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH075Z90 880x528
#endif

// Arduino MKR1000 or MKRZERO
Expand Down Expand Up @@ -92,6 +93,7 @@
//GxEPD2_3C<GxEPD2_583c, MAX_HEIGHT_3C(GxEPD2_583c)> display(GxEPD2_583c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5));
//GxEPD2_3C<GxEPD2_750c, MAX_HEIGHT_3C(GxEPD2_750c)> display(GxEPD2_750c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5));
//GxEPD2_3C<GxEPD2_750c_Z08, MAX_HEIGHT_3C(GxEPD2_750c_Z08)> display(GxEPD2_750c_Z08(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW075Z08 800x480
//GxEPD2_3C<GxEPD2_750c_Z90, MAX_HEIGHT_3C(GxEPD2_750c_Z90)> display(GxEPD2_750c_Z90(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH075Z90 880x528
#endif

// mapping suggestion for ESP32, e.g. LOLIN32 D32 PRO
Expand Down Expand Up @@ -128,6 +130,7 @@
//GxEPD2_3C<GxEPD2_583c, GxEPD2_583c::HEIGHT> display(GxEPD2_583c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15));
//GxEPD2_3C<GxEPD2_750c, GxEPD2_750c::HEIGHT> display(GxEPD2_750c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15));
//GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT> display(GxEPD2_750c_Z08(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW075Z08 800x480
//GxEPD2_3C<GxEPD2_750c_Z90, GxEPD2_750c_Z90::HEIGHT> display(GxEPD2_750c_Z90(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH075Z90 880x528
// grey levels parallel IF e-papers on Waveshare e-Paper IT8951 Driver HAT
// HRDY -> 4, RST -> 16, CS -> 5, SCK -> SCK(18), MOSI -> MOSI(23), MISO -> MISO(19), GND -> GND, 5V -> 5V
// note: 5V supply needs to be exact and strong; 5V over diode from USB (e.g. Wemos D1 mini) doesn't work!
Expand Down Expand Up @@ -168,6 +171,7 @@
//GxEPD2_3C<GxEPD2_583c, GxEPD2_583c::HEIGHT> display(GxEPD2_583c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4));
//GxEPD2_3C<GxEPD2_750c, GxEPD2_750c::HEIGHT> display(GxEPD2_750c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4));
//GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT> display(GxEPD2_750c_Z08(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW075Z08 800x480
//GxEPD2_3C<GxEPD2_750c_Z90, GxEPD2_750c_Z90::HEIGHT> display(GxEPD2_750c_Z90(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH075Z90 880x528
// grey levels parallel IF e-papers on Waveshare e-Paper IT8951 Driver HAT
// HRDY -> 4, RST -> 16, CS -> SS(5), SCK -> SCK(18), MOSI -> MOSI(23), MISO -> MISO(19), GND -> GND, 5V -> 5V
// note: 5V supply needs to be exact and strong; 5V over diode from USB (e.g. Wemos D1 mini) doesn't work!
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=GxEPD2
version=1.2.9
version=1.2.10
author=Jean-Marc Zingg
maintainer=Jean-Marc Zingg
sentence=Arduino Display Library for SPI E-Paper displays from Dalian Good Display and Waveshare.
Expand Down
3 changes: 2 additions & 1 deletion src/GxEPD2.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class GxEPD2
GDEW042Z15, Waveshare_4_2_bwr = GDEW042Z15,
GDEW0583Z21, Waveshare_5_83_bwr = GDEW0583Z21,
GDEW075Z09, Waveshare_7_5_bwr = GDEW075Z09,
GDEW075Z08, Waveshare_7_5_bwr_Z08 = GDEW075Z08
GDEW075Z08, Waveshare_7_5_bwr_Z08 = GDEW075Z08,
GDEH075Z90, Waveshare_7_5_bwr_Z90 = GDEH075Z90
};
};

Expand Down
6 changes: 4 additions & 2 deletions src/GxEPD2_3C.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#include "epd3c/GxEPD2_583c.h"
#include "epd3c/GxEPD2_750c.h"
#include "epd3c/GxEPD2_750c_Z08.h"
#include "epd3c/GxEPD2_750c_Z90.h"

template<typename GxEPD2_Type, const uint16_t page_height>
class GxEPD2_3C : public GxEPD2_GFX_BASE_CLASS
Expand Down Expand Up @@ -121,10 +122,11 @@ class GxEPD2_3C : public GxEPD2_GFX_BASE_CLASS
// init method with additional parameters:
// initial false for re-init after processor deep sleep wake up, if display power supply was kept
// only relevant for b/w displays with fast partial update
// reset_duration = 20 is default; a value of 2 may help with "clever" reset circuit of newer boards from Waveshare
// pulldown_rst_mode true for alternate RST handling to avoid feeding 5V through RST pin
void init(uint32_t serial_diag_bitrate, bool initial, bool pulldown_rst_mode = false)
void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration = 20, bool pulldown_rst_mode = false)
{
epd2.init(serial_diag_bitrate, initial, pulldown_rst_mode);
epd2.init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode);
_using_partial_mode = false;
_current_page = 0;
setFullWindow();
Expand Down
5 changes: 3 additions & 2 deletions src/GxEPD2_BW.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ class GxEPD2_BW : public GxEPD2_GFX_BASE_CLASS
// initial false for re-init after processor deep sleep wake up, if display power supply was kept
// this can be used to avoid the repeated initial full refresh on displays with fast partial update
// NOTE: garbage will result on fast partial update displays, if initial full update is omitted after power loss
// reset_duration = 20 is default; a value of 2 may help with "clever" reset circuit of newer boards from Waveshare
// pulldown_rst_mode true for alternate RST handling to avoid feeding 5V through RST pin
void init(uint32_t serial_diag_bitrate, bool initial, bool pulldown_rst_mode = false)
void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration = 20, bool pulldown_rst_mode = false)
{
epd2.init(serial_diag_bitrate, initial, pulldown_rst_mode);
epd2.init(serial_diag_bitrate, initial, reset_duration, pulldown_rst_mode);
_using_partial_mode = false;
_current_page = 0;
setFullWindow();
Expand Down
10 changes: 6 additions & 4 deletions src/GxEPD2_EPD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,23 @@ GxEPD2_EPD::GxEPD2_EPD(int8_t cs, int8_t dc, int8_t rst, int8_t busy, int8_t bus
_power_is_on = false;
_using_partial_mode = false;
_hibernating = false;
_reset_duration = 20;
}

void GxEPD2_EPD::init(uint32_t serial_diag_bitrate)
{
init(serial_diag_bitrate, true, false);
init(serial_diag_bitrate, true, 20, false);
}

void GxEPD2_EPD::init(uint32_t serial_diag_bitrate, bool initial, bool pulldown_rst_mode)
void GxEPD2_EPD::init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration, bool pulldown_rst_mode)
{
_initial_write = initial;
_initial_refresh = initial;
_pulldown_rst_mode = pulldown_rst_mode;
_power_is_on = false;
_using_partial_mode = false;
_hibernating = false;
_reset_duration = reset_duration;
if (serial_diag_bitrate > 0)
{
Serial.begin(serial_diag_bitrate);
Expand Down Expand Up @@ -74,7 +76,7 @@ void GxEPD2_EPD::_reset()
{
digitalWrite(_rst, LOW);
pinMode(_rst, OUTPUT);
delay(20);
delay(_reset_duration);
pinMode(_rst, INPUT_PULLUP);
delay(200);
}
Expand All @@ -84,7 +86,7 @@ void GxEPD2_EPD::_reset()
pinMode(_rst, OUTPUT);
delay(20);
digitalWrite(_rst, LOW);
delay(20);
delay(_reset_duration);
digitalWrite(_rst, HIGH);
delay(200);
}
Expand Down
3 changes: 2 additions & 1 deletion src/GxEPD2_EPD.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class GxEPD2_EPD
GxEPD2_EPD(int8_t cs, int8_t dc, int8_t rst, int8_t busy, int8_t busy_level, uint32_t busy_timeout,
uint16_t w, uint16_t h, GxEPD2::Panel p, bool c, bool pu, bool fpu);
virtual void init(uint32_t serial_diag_bitrate = 0); // serial_diag_bitrate = 0 : disabled
virtual void init(uint32_t serial_diag_bitrate, bool initial, bool pulldown_rst_mode = false);
virtual void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration = 20, bool pulldown_rst_mode = false);
// Support for Bitmaps (Sprites) to Controller Buffer and to Screen
virtual void clearScreen(uint8_t value) = 0; // init controller memory and screen (default white)
virtual void writeScreenBuffer(uint8_t value) = 0; // init controller memory (default white)
Expand Down Expand Up @@ -105,6 +105,7 @@ class GxEPD2_EPD
SPISettings _spi_settings;
bool _initial_write, _initial_refresh;
bool _power_is_on, _using_partial_mode, _hibernating;
uint16_t _reset_duration;
};

#endif
2 changes: 1 addition & 1 deletion src/GxEPD2_GFX.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class GxEPD2_GFX : public GxEPD2_GFX_ROOT_CLASS
// this can be used to avoid the repeated initial full refresh on displays with fast partial update
// NOTE: garbage will result on fast partial update displays, if initial full update is omitted after power loss
// pulldown_rst_mode true for alternate RST handling to avoid feeding 5V through RST pin
virtual void init(uint32_t serial_diag_bitrate, bool initial, bool pulldown_rst_mode = false) = 0;
virtual void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration = 20, bool pulldown_rst_mode = false) = 0;
virtual void fillScreen(uint16_t color) = 0; // 0x0 black, >0x0 white, to buffer
// display buffer content to screen, useful for full screen buffer
virtual void display(bool partial_update_mode = false) = 0;
Expand Down
Loading

0 comments on commit bde0026

Please sign in to comment.