Skip to content

Commit

Permalink
Version 1.1.4
Browse files Browse the repository at this point in the history
- eliminated double refresh for "fast partial update"
- moved wavetables to the driver classes
- added one explicit drawImage(...) and writeImage(...) method (for removed default paramter values for 1.1.3)
- added init method with added parameter  initial, for re-init after processor deep sleep wakeup
- added init parameter pulldown_rst_mode, for special RST handling (not needed for waveshare shield)
  • Loading branch information
ZinggJM committed Feb 10, 2019
1 parent f476d92 commit d525f54
Show file tree
Hide file tree
Showing 42 changed files with 899 additions and 1,200 deletions.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,31 @@
- Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0
- Good Dispay ePaper for Arduino : https://forum.arduino.cc/index.php?topic=436411.0

### Version 1.1.3
### Supported SPI e-paper panels from Good Display:
- GDEP015OC1 1.54" b/w
- GDEW0154Z04 1.54" b/w/r 200x200
- GDE0213B1 2.13" b/w
- GDEW0213I5F 2.13" b/w flexible
- GDEW0213Z16 2.13" b/w/r
- GDEH029A1 2.9" b/w
- GDEW029T5 2.9" b/w
- GDEW029Z10 2.9" b/w/r
- GDEW027C44 2.7" b/w/r
- GDEW027W3 2.7" b/w
- GDEW042T2 4.2" b/w
- GDEW042Z15 4.2" b/w/r
- GDEW0583T7 5.83" b/w
- GDEW075T8 7.5" b/w
- GDEW075Z09 7.5" b/w/r
#### Supported SPI e-paper panels & boards from Waveshare: compare with Good Display, same panel

### Version 1.1.4
- eliminated double refresh for "fast partial update"
- moved wavetables to the driver classes
- added one explicit drawImage(...) and writeImage(...) method (for removed default paramter values for 1.1.3)
- added init method with added parameter initial, for re-init after processor deep sleep wakeup
- added init parameter pulldown_rst_mode, for special RST handling (not needed for waveshare shield)
#### Version 1.1.3
- fixed wavetables for GDEW029T5 and GDEW0213I5F
- fixed drawImage(...) overloaded methods signature matching ambiguity
#### Version 1.1.2
Expand Down
35 changes: 18 additions & 17 deletions examples/GxEPD2_Example/GxEPD2_Example.ino
Original file line number Diff line number Diff line change
Expand Up @@ -162,26 +162,27 @@
//GxEPD2_3C<GxEPD2_750c, MAX_HEIGHT_3C(GxEPD2_750c)> display(GxEPD2_750c(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7));

// ***** for mapping of Waveshare Universal e-Paper Raw Panel Driver Shield for Arduino / NUCLEO *****
// CAUTION: the RST line is not connected through level converter! This may damage the display and/or cause malfunction. use -1 for RST parameter
// 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
// NOTE: the 11-pinholes for pin connectors are not through level converter, and the VCC pin is 5V, only FCP connector pins are through level converter
// select one and adapt to your mapping
//GxEPD2_BW<GxEPD2_154, MAX_HEIGHT(GxEPD2_154)> display(GxEPD2_154(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_213, MAX_HEIGHT(GxEPD2_213)> display(GxEPD2_213(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_213_flex, MAX_HEIGHT(GxEPD2_213_flex)> display(GxEPD2_213_flex(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7)); // GDEW0213I5F
//GxEPD2_BW<GxEPD2_290, MAX_HEIGHT(GxEPD2_290)> display(GxEPD2_290(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_290_T5, MAX_HEIGHT(GxEPD2_290_T5)> display(GxEPD2_290_T5(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7)); // GDEW029T5
//GxEPD2_BW<GxEPD2_270, MAX_HEIGHT(GxEPD2_270)> display(GxEPD2_270(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_420, MAX_HEIGHT(GxEPD2_420)> display(GxEPD2_420(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_583, MAX_HEIGHT(GxEPD2_583)> display(GxEPD2_583(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_750, MAX_HEIGHT(GxEPD2_750)> display(GxEPD2_750(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_154, MAX_HEIGHT(GxEPD2_154)> display(GxEPD2_154(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_213, MAX_HEIGHT(GxEPD2_213)> display(GxEPD2_213(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_213_flex, MAX_HEIGHT(GxEPD2_213_flex)> display(GxEPD2_213_flex(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213I5F
//GxEPD2_BW<GxEPD2_290, MAX_HEIGHT(GxEPD2_290)> display(GxEPD2_290(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_290_T5, MAX_HEIGHT(GxEPD2_290_T5)> display(GxEPD2_290_T5(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029T5
//GxEPD2_BW<GxEPD2_270, MAX_HEIGHT(GxEPD2_270)> display(GxEPD2_270(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_420, MAX_HEIGHT(GxEPD2_420)> display(GxEPD2_420(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_583, MAX_HEIGHT(GxEPD2_583)> display(GxEPD2_583(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_BW<GxEPD2_750, MAX_HEIGHT(GxEPD2_750)> display(GxEPD2_750(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
// 3-color e-papers
#define MAX_HEIGHT_3C(EPD) (EPD::HEIGHT <= (MAX_DISPAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8))
//GxEPD2_3C<GxEPD2_154c, MAX_HEIGHT_3C(GxEPD2_154c)> display(GxEPD2_154c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_213c, MAX_HEIGHT_3C(GxEPD2_213c)> display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_290c, MAX_HEIGHT_3C(GxEPD2_290c)> display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_270c, MAX_HEIGHT_3C(GxEPD2_270c)> display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_420c, MAX_HEIGHT_3C(GxEPD2_420c)> display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_583c, MAX_HEIGHT_3C(GxEPD2_583c)> display(GxEPD2_583c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_750c, MAX_HEIGHT_3C(GxEPD2_750c)> display(GxEPD2_750c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ -1, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_154c, MAX_HEIGHT_3C(GxEPD2_154c)> display(GxEPD2_154c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_213c, MAX_HEIGHT_3C(GxEPD2_213c)> display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_290c, MAX_HEIGHT_3C(GxEPD2_290c)> display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_270c, MAX_HEIGHT_3C(GxEPD2_270c)> display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7));
//GxEPD2_3C<GxEPD2_420c, MAX_HEIGHT_3C(GxEPD2_420c)> display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 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));
#endif

#include "GxEPD2_boards_added.h"
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.1.3
version=1.1.4
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
20 changes: 20 additions & 0 deletions src/GxEPD2_3C.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,18 @@ class GxEPD2_3C : public Adafruit_GFX
setFullWindow();
}

// init method with additional parameters:
// initial true 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
// 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)
{
epd2.init(serial_diag_bitrate, initial, pulldown_rst_mode);
_using_partial_mode = false;
_current_page = 0;
setFullWindow();
}

void fillScreen(uint16_t color) // 0x0 black, >0x0 white, to buffer
{
uint8_t black = 0xFF;
Expand Down Expand Up @@ -328,6 +340,10 @@ class GxEPD2_3C : public Adafruit_GFX
{
epd2.writeImage(black, color, x, y, w, h, invert, mirror_y, pgm);
}
void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h)
{
epd2.writeImage(black, color, x, y, w, h, false, false, false);
}
// write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
Expand All @@ -342,6 +358,10 @@ class GxEPD2_3C : public Adafruit_GFX
{
epd2.drawImage(black, color, x, y, w, h, invert, mirror_y, pgm);
}
void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h)
{
epd2.drawImage(black, color, x, y, w, h, false, false, false);
}
// write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8
void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
Expand Down
57 changes: 53 additions & 4 deletions src/GxEPD2_BW.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,19 @@ class GxEPD2_BW : public Adafruit_GFX
setFullWindow();
}

// init method with additional parameters:
// initial true 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
// 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)
{
epd2.init(serial_diag_bitrate, initial, pulldown_rst_mode);
_using_partial_mode = false;
_current_page = 0;
setFullWindow();
}

void fillScreen(uint16_t color) // 0x0 black, >0x0 white, to buffer
{
uint8_t data = (color == GxEPD_BLACK) ? 0x00 : 0xFF;
Expand Down Expand Up @@ -180,7 +193,7 @@ class GxEPD2_BW : public Adafruit_GFX
if (epd2.hasFastPartialUpdate)
{
epd2.writeImageAgain(_buffer + offset, _pw_x, _pw_y, _pw_w, _pw_h);
epd2.refresh(_pw_x, _pw_y, _pw_w, _pw_h);
//epd2.refresh(_pw_x, _pw_y, _pw_w, _pw_h); // not needed
}
}
else // full update
Expand All @@ -190,7 +203,7 @@ class GxEPD2_BW : public Adafruit_GFX
if (epd2.hasFastPartialUpdate)
{
epd2.writeImageAgain(_buffer, 0, 0, WIDTH, HEIGHT);
epd2.refresh(true);
//epd2.refresh(true); // not needed
epd2.powerOff();
}
}
Expand Down Expand Up @@ -254,7 +267,7 @@ class GxEPD2_BW : public Adafruit_GFX
fillScreen(GxEPD_WHITE);
return true;
}
else epd2.refresh(true); // partial update after second phase
//else epd2.refresh(true); // partial update after second phase
} else epd2.refresh(false); // full update after only phase
epd2.powerOff();
return false;
Expand All @@ -267,6 +280,34 @@ class GxEPD2_BW : public Adafruit_GFX
// GxEPD style paged drawing; drawCallback() is called as many times as needed
void drawPaged(void (*drawCallback)(const void*), const void* pv)
{
if (1 == _pages)
{
fillScreen(GxEPD_WHITE);
drawCallback(pv);
if (_using_partial_mode)
{
uint32_t offset = _reverse ? (HEIGHT - _pw_h) * _pw_w / 8 : 0;
epd2.writeImage(_buffer + offset, _pw_x, _pw_y, _pw_w, _pw_h);
epd2.refresh(_pw_x, _pw_y, _pw_w, _pw_h);
if (epd2.hasFastPartialUpdate)
{
epd2.writeImageAgain(_buffer + offset, _pw_x, _pw_y, _pw_w, _pw_h);
//epd2.refresh(_pw_x, _pw_y, _pw_w, _pw_h); // not needed
}
}
else // full update
{
epd2.writeImage(_buffer, 0, 0, WIDTH, HEIGHT);
epd2.refresh(false);
if (epd2.hasFastPartialUpdate)
{
epd2.writeImageAgain(_buffer, 0, 0, WIDTH, HEIGHT);
//epd2.refresh(true); // not needed
epd2.powerOff();
}
}
return;
}
if (_using_partial_mode)
{
for (uint16_t phase = 1; phase <= 2; phase++)
Expand Down Expand Up @@ -311,7 +352,7 @@ class GxEPD2_BW : public Adafruit_GFX
drawCallback(pv);
epd2.writeImageAgain(_buffer, 0, page_ys, WIDTH, gx_uint16_min(_page_height, HEIGHT - page_ys));
}
epd2.refresh(true); // partial update after second phase
//epd2.refresh(true); // partial update after second phase // not needed
}
epd2.powerOff();
}
Expand Down Expand Up @@ -362,6 +403,10 @@ class GxEPD2_BW : public Adafruit_GFX
{
epd2.writeImage(black, color, x, y, w, h, invert, mirror_y, pgm);
}
void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h)
{
epd2.writeImage(black, color, x, y, w, h, false, false, false);
}
// write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8
void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
Expand All @@ -376,6 +421,10 @@ class GxEPD2_BW : public Adafruit_GFX
{
epd2.drawImage(black, color, x, y, w, h, invert, mirror_y, pgm);
}
void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h)
{
epd2.drawImage(black, color, x, y, w, h, false, false, false);
}
// write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8
void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm)
{
Expand Down
61 changes: 40 additions & 21 deletions src/GxEPD2_EPD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,23 @@ GxEPD2_EPD::GxEPD2_EPD(int8_t cs, int8_t dc, int8_t rst, int8_t busy, int8_t bus
_cs(cs), _dc(dc), _rst(rst), _busy(busy), _busy_level(busy_level), _busy_timeout(busy_timeout), _diag_enabled(false),
_spi_settings(4000000, MSBFIRST, SPI_MODE0)
{
_power_is_on = false;
_using_partial_mode = false;
_hibernating = false;
}

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

void GxEPD2_EPD::init(uint32_t serial_diag_bitrate, bool initial, bool pulldown_rst_mode)
{
_initial = initial;
_pulldown_rst_mode = pulldown_rst_mode;
_power_is_on = false;
_using_partial_mode = false;
_hibernating = false;
if (serial_diag_bitrate > 0)
{
Serial.begin(serial_diag_bitrate);
Expand All @@ -42,32 +55,38 @@ void GxEPD2_EPD::init(uint32_t serial_diag_bitrate)
digitalWrite(_dc, HIGH);
pinMode(_dc, OUTPUT);
}
if (_rst >= 0)
{
digitalWrite(_rst, HIGH);
pinMode(_rst, OUTPUT);
delay(20);
digitalWrite(_rst, LOW);
delay(20);
digitalWrite(_rst, HIGH);
delay(200);
}
_reset();
if (_busy >= 0)
{
pinMode(_busy, INPUT);
}
SPI.begin();
// SPI.setDataMode(SPI_MODE0);
// SPI.setBitOrder(MSBFIRST);
//#if defined(SPI_HAS_TRANSACTION)
// // true also for STM32F1xx Boards
// SPISettings settings(4000000, MSBFIRST, SPI_MODE0);
// SPI.beginTransaction(settings);
// SPI.endTransaction();
// //Serial.println("SPI has Transaction");
//#elif defined(ESP8266) || defined(ESP32)
// SPI.setFrequency(4000000);
//#endif
}

void GxEPD2_EPD::_reset()
{
if (_rst >= 0)
{
if (_pulldown_rst_mode)
{
digitalWrite(_rst, LOW);
pinMode(_rst, OUTPUT);
delay(20);
pinMode(_rst, INPUT_PULLUP);
delay(200);
}
else
{
digitalWrite(_rst, HIGH);
pinMode(_rst, OUTPUT);
delay(20);
digitalWrite(_rst, LOW);
delay(20);
digitalWrite(_rst, HIGH);
delay(200);
}
_hibernating = false;
}
}

void GxEPD2_EPD::_waitWhileBusy(const char* comment, uint16_t busy_time)
Expand Down
7 changes: 5 additions & 2 deletions src/GxEPD2_EPD.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ class GxEPD2_EPD
// constructor
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) = 0; // serial_diag_bitrate = 0 : disabled
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);
// 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 @@ -60,6 +61,7 @@ class GxEPD2_EPD
return (a > b ? a : b);
};
protected:
void _reset();
void _waitWhileBusy(const char* comment = 0, uint16_t busy_time = 5000);
void _writeCommand(uint8_t c);
void _writeData(uint8_t d);
Expand All @@ -70,8 +72,9 @@ class GxEPD2_EPD
protected:
int8_t _cs, _dc, _rst, _busy, _busy_level;
uint32_t _busy_timeout;
bool _diag_enabled;
bool _diag_enabled, _pulldown_rst_mode;
SPISettings _spi_settings;
bool _initial, _power_is_on, _using_partial_mode, _hibernating;
};

#endif
8 changes: 8 additions & 0 deletions src/GxEPD2_GFX.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ class GxEPD2_GFX : public Adafruit_GFX
virtual uint16_t pageHeight() = 0;
virtual bool mirror(bool m) = 0;
virtual void init(uint32_t serial_diag_bitrate = 0) = 0; // serial_diag_bitrate = 0 : disabled
// init method with additional parameters:
// initial true 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
// 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 fillScreen(uint16_t color) = 0; // 0x0 black, >0x0 white, to buffer
virtual void display(bool partial_update_mode = false) = 0;
virtual void setFullWindow() = 0;
Expand All @@ -41,9 +47,11 @@ class GxEPD2_GFX : public Adafruit_GFX
// write to controller memory, without screen refresh; x and w should be multiple of 8
virtual void writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) = 0;
virtual void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) = 0;
virtual void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h) = 0; // default options false
// write to controller memory, with screen refresh; x and w should be multiple of 8
virtual void drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) = 0;
virtual void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) = 0;
virtual void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h) = 0; // default options false
virtual void refresh(bool partial_update_mode = false) = 0; // screen refresh from controller memory to full screen
virtual void refresh(int16_t x, int16_t y, int16_t w, int16_t h) = 0; // screen refresh from controller memory, partial screen
virtual void powerOff() = 0; // turns off generation of panel driving voltages, avoids screen fading over time
Expand Down
Loading

0 comments on commit d525f54

Please sign in to comment.