├── extras ├── bitmaps │ ├── bb4.bmp │ ├── logo.bmp │ ├── test.bmp │ ├── woof.bmp │ ├── parrot.bmp │ ├── tiger.bmp │ ├── betty_1.bmp │ ├── betty_4.bmp │ ├── miniwoof.bmp │ ├── output5.bmp │ ├── output6.bmp │ ├── t200x200.bmp │ ├── tiger16T.bmp │ ├── tractor_1.bmp │ ├── tractor_4.bmp │ ├── tractor_8.bmp │ ├── logo200x200.bmp │ ├── tractor_11.bmp │ ├── tractor_44.bmp │ ├── tractor_88.bmp │ ├── eighth200x200.bmp │ ├── fifth200x200.bmp │ ├── first200x200.bmp │ ├── fourth200x200.bmp │ ├── second200x200.bmp │ ├── seventh200x200.bmp │ ├── sixth200x200.bmp │ ├── third200x200.bmp │ ├── Bitmap640x384_1.bmp │ ├── Bitmap640x384_2.bmp │ ├── liberato640x384.bmp │ ├── tiger_178x160x4.bmp │ ├── tiger_240x317x4.bmp │ ├── tiger_320x200x24.bmp │ ├── z0gs │ │ └── screenshot.bmp │ ├── displayed_bmp_large.bmp │ ├── marilyn_240x240x8.bmp │ └── displayed_bmp_small_but_padded.bmp ├── Particle │ └── examples │ │ ├── GxEPD2_ParticleExample │ │ └── project.properties │ │ └── GxEPD2_WiFi_ParticleExample │ │ └── project.properties ├── sw_spi │ ├── README.MD │ └── README.txt └── tests │ ├── GxEPD2_MinimumExample │ ├── GxEPD2_MinimumExample.ino │ ├── GxEPD2_selection_check.h │ └── GxEPD2_wiring_examples.h │ └── GxEPD2_RefreshTests │ ├── GxEPD2_selection_check.h │ └── GxEPD2_wiring_examples.h ├── examples ├── GxEPD2_SD_Example │ └── bitmaps │ │ ├── LOGO.BMP │ │ ├── bb4.bmp │ │ ├── parrot.bmp │ │ ├── rgb32.bmp │ │ ├── 5in65f3.bmp │ │ ├── betty_1.bmp │ │ ├── logo200x200.bmp │ │ ├── eighth200x200.bmp │ │ ├── fifth200x200.bmp │ │ ├── first200x200.bmp │ │ ├── fourth200x200.bmp │ │ ├── second200x200.bmp │ │ ├── seventh200x200.bmp │ │ ├── sixth200x200.bmp │ │ ├── third200x200.bmp │ │ ├── Bitmap640x384_1.bmp │ │ └── Bitmap640x384_2.bmp ├── GxEPD2_WiFi_CertStore_Loader │ ├── certs.ar │ ├── update_certs │ │ ├── update_certs.cmd │ │ └── certs-from-mozilla.py │ └── SPIFFS_Support.ino ├── GxEPD2_GFX_Example │ ├── TextDisplay.h │ └── BitmapDisplay.h ├── GxEPD2_SD_AVR_Example │ └── GxEPD2_SD_AVR_boards_added.h ├── GxEPD2_Spiffs_Example │ └── SPIFFS_Support.ino ├── GxEPD2_Spiffs_Loader │ └── SPIFFS_Support.ino ├── GxEPD2_HelloWorld │ └── GxEPD2_HelloWorld.ino ├── GxEPD2x_FastBlackWhiteOnColor │ └── GxEPD2x_FastBlackWhiteOnColor.ino ├── GxEPD2x_MixedTest │ └── GxEPD2x_MixedTest.ino └── GxEPD2_RotaryUsingBusyCallback │ └── BasicEncoder.h ├── library.properties ├── resources ├── GDEM0102T91 │ ├── Display_EPD_W21_spi.cpp │ ├── Display_EPD_W21_spi.h │ ├── Display_EPD_W21.h │ └── GDEM0102T91_Arduino.ino └── GDEM075F52 │ └── Display_EPD_W21.h ├── CONTRIBUTING.md └── src ├── epd ├── GxEPD2_750.h ├── GxEPD2_583.h ├── GxEPD2_154.h ├── GxEPD2_290.h ├── GxEPD2_074_E2741CS0B2.h ├── GxEPD2_213.h ├── GxEPD2_290_M06.h ├── GxEPD2_213_M21.h ├── GxEPD2_260_M01.h ├── GxEPD2_213_flex.h └── GxEPD2_290_T5.h ├── GxEPD2.h ├── epd3c ├── GxEPD2_154_Z90c.h ├── GxEPD2_290_C90c.h ├── GxEPD2_583c.h ├── GxEPD2_750c.h ├── GxEPD2_420c.h ├── GxEPD2_213c.h ├── GxEPD2_290c.h ├── GxEPD2_266c.h ├── GxEPD2_213_Z98c.h ├── GxEPD2_420c_Z21.h ├── GxEPD2_583c_Z83.h ├── GxEPD2_750c_Z08.h ├── GxEPD2_074c_E2741FS081.h └── GxEPD2_270c.h └── epd7c └── GxEPD2_565c.h /extras/bitmaps/bb4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/bb4.bmp -------------------------------------------------------------------------------- /extras/bitmaps/logo.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/logo.bmp -------------------------------------------------------------------------------- /extras/bitmaps/test.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/test.bmp -------------------------------------------------------------------------------- /extras/bitmaps/woof.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/woof.bmp -------------------------------------------------------------------------------- /extras/bitmaps/parrot.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/parrot.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tiger.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tiger.bmp -------------------------------------------------------------------------------- /extras/bitmaps/betty_1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/betty_1.bmp -------------------------------------------------------------------------------- /extras/bitmaps/betty_4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/betty_4.bmp -------------------------------------------------------------------------------- /extras/bitmaps/miniwoof.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/miniwoof.bmp -------------------------------------------------------------------------------- /extras/bitmaps/output5.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/output5.bmp -------------------------------------------------------------------------------- /extras/bitmaps/output6.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/output6.bmp -------------------------------------------------------------------------------- /extras/bitmaps/t200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/t200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tiger16T.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tiger16T.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tractor_1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tractor_1.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tractor_4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tractor_4.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tractor_8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tractor_8.bmp -------------------------------------------------------------------------------- /extras/bitmaps/logo200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/logo200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tractor_11.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tractor_11.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tractor_44.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tractor_44.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tractor_88.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tractor_88.bmp -------------------------------------------------------------------------------- /extras/Particle/examples/GxEPD2_ParticleExample/project.properties: -------------------------------------------------------------------------------- 1 | name=GxEPD2_ParticleExample 2 | dependencies.GxEPD2=1.2.4 -------------------------------------------------------------------------------- /extras/bitmaps/eighth200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/eighth200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/fifth200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/fifth200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/first200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/first200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/fourth200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/fourth200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/second200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/second200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/seventh200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/seventh200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/sixth200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/sixth200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/third200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/third200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/Bitmap640x384_1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/Bitmap640x384_1.bmp -------------------------------------------------------------------------------- /extras/bitmaps/Bitmap640x384_2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/Bitmap640x384_2.bmp -------------------------------------------------------------------------------- /extras/bitmaps/liberato640x384.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/liberato640x384.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tiger_178x160x4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tiger_178x160x4.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tiger_240x317x4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tiger_240x317x4.bmp -------------------------------------------------------------------------------- /extras/bitmaps/tiger_320x200x24.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/tiger_320x200x24.bmp -------------------------------------------------------------------------------- /extras/bitmaps/z0gs/screenshot.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/z0gs/screenshot.bmp -------------------------------------------------------------------------------- /extras/Particle/examples/GxEPD2_WiFi_ParticleExample/project.properties: -------------------------------------------------------------------------------- 1 | name=GxEPD2_WiFi_ParticleExample 2 | dependencies.GxEPD2=1.2.4 -------------------------------------------------------------------------------- /extras/bitmaps/displayed_bmp_large.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/displayed_bmp_large.bmp -------------------------------------------------------------------------------- /extras/bitmaps/marilyn_240x240x8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/marilyn_240x240x8.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/LOGO.BMP: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/LOGO.BMP -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/bb4.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/bb4.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/parrot.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/parrot.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/rgb32.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/rgb32.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/5in65f3.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/5in65f3.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/betty_1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/betty_1.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_WiFi_CertStore_Loader/certs.ar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_WiFi_CertStore_Loader/certs.ar -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/logo200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/logo200x200.bmp -------------------------------------------------------------------------------- /extras/bitmaps/displayed_bmp_small_but_padded.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/extras/bitmaps/displayed_bmp_small_but_padded.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/eighth200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/eighth200x200.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/fifth200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/fifth200x200.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/first200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/first200x200.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/fourth200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/fourth200x200.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/second200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/second200x200.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/seventh200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/seventh200x200.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/sixth200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/sixth200x200.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/third200x200.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/third200x200.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/Bitmap640x384_1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/Bitmap640x384_1.bmp -------------------------------------------------------------------------------- /examples/GxEPD2_SD_Example/bitmaps/Bitmap640x384_2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/MultiTricker/GxEPD2/master/examples/GxEPD2_SD_Example/bitmaps/Bitmap640x384_2.bmp -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=GxEPD2 2 | version=1.6.5 3 | author=Jean-Marc Zingg 4 | maintainer=Jean-Marc Zingg 5 | sentence=Arduino Display Library for SPI E-Paper displays from Dalian Good Display and Waveshare. 6 | paragraph=Requires HW SPI and Adafruit_GFX. Caution: the bare e-paper panels require 3.3V supply AND data lines! 7 | category=Display 8 | url=https://github.com/ZinggJM/GxEPD2 9 | architectures=* 10 | depends=Adafruit GFX Library 11 | -------------------------------------------------------------------------------- /resources/GDEM0102T91/Display_EPD_W21_spi.cpp: -------------------------------------------------------------------------------- 1 | #include "Display_EPD_W21_spi.h" 2 | #include 3 | 4 | //SPI write byte 5 | void SPI_Write(unsigned char value) 6 | { 7 | SPI.transfer(value); 8 | } 9 | 10 | //SPI write command 11 | void EPD_W21_WriteCMD(unsigned char command) 12 | { 13 | EPD_W21_CS_0; 14 | EPD_W21_DC_0; // D/C# 0:command 1:data 15 | SPI_Write(command); 16 | EPD_W21_CS_1; 17 | } 18 | //SPI write data 19 | void EPD_W21_WriteDATA(unsigned char datas) 20 | { 21 | EPD_W21_CS_0; 22 | EPD_W21_DC_1; // D/C# 0:command 1:data 23 | SPI_Write(datas); 24 | EPD_W21_CS_1; 25 | } 26 | -------------------------------------------------------------------------------- /resources/GDEM0102T91/Display_EPD_W21_spi.h: -------------------------------------------------------------------------------- 1 | #ifndef _DISPLAY_EPD_W21_SPI_ 2 | #define _DISPLAY_EPD_W21_SPI_ 3 | #include "Arduino.h" 4 | 5 | //IO settings 6 | //SCK--GPIO23(SCLK) 7 | //SDIN---GPIO18(MOSI) 8 | #define isEPD_W21_BUSY digitalRead(A14) //BUSY 9 | #define EPD_W21_RST_0 digitalWrite(A15,LOW) //RES 10 | #define EPD_W21_RST_1 digitalWrite(A15,HIGH) 11 | #define EPD_W21_DC_0 digitalWrite(A16,LOW) //DC 12 | #define EPD_W21_DC_1 digitalWrite(A16,HIGH) 13 | #define EPD_W21_CS_0 digitalWrite(A17,LOW) //CS 14 | #define EPD_W21_CS_1 digitalWrite(A17,HIGH) 15 | 16 | 17 | void SPI_Write(unsigned char value); 18 | void EPD_W21_WriteDATA(unsigned char datas); 19 | void EPD_W21_WriteCMD(unsigned char command); 20 | 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /examples/GxEPD2_WiFi_CertStore_Loader/update_certs/update_certs.cmd: -------------------------------------------------------------------------------- 1 | ECHO OFF 2 | REM update_certs.cmd : update certs.ar with actual pems retrieved from mozilla 3 | REM 4 | REM see also %LOCALAPPDATA%\Arduino15\packages\esp8266\hardware\esp8266\3.0.2\libraries\ESP8266WiFi\examples\BearSSL_CertStore 5 | REM 6 | REM you may need to install openssl e.g. from https://kb.firedaemon.com/support/solutions/articles/4000121705 7 | REM windows installer here: https://download.firedaemon.com/FireDaemon-OpenSSL/FireDaemon-OpenSSL-x64-3.0.7.exe 8 | REM 9 | SET PATH=%LOCALAPPDATA%\Arduino15\packages\esp8266\tools\python3\3.7.2-post1;%LOCALAPPDATA%\Arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\3.0.4-gcc10.3-1757bed\xtensa-lx106-elf\bin;%PATH% 10 | python3 certs-from-mozilla.py 11 | REM 12 | REM copy certs.ar manually to parent directory 13 | REM 14 | -------------------------------------------------------------------------------- /resources/GDEM075F52/Display_EPD_W21.h: -------------------------------------------------------------------------------- 1 | #ifndef _DISPLAY_EPD_W21_H_ 2 | #define _DISPLAY_EPD_W21_H_ 3 | 4 | //2bit 5 | #define black 0x00 /// 00 6 | #define white 0x01 /// 01 7 | #define yellow 0x02 /// 10 8 | #define red 0x03 /// 11 9 | 10 | 11 | #define Source_BITS 800 12 | #define Gate_BITS 480 13 | #define ALLSCREEN_BYTES Source_BITS*Gate_BITS/4 14 | 15 | 16 | //EPD 17 | void EPD_init(void); 18 | void PIC_display (const unsigned char* picData); 19 | void EPD_sleep(void); 20 | void EPD_refresh(void); 21 | void lcd_chkstatus(void); 22 | 23 | void Display_All_Black(void); 24 | void Display_All_White(void); 25 | void Display_All_Yellow(void); 26 | void Display_All_Red(void); 27 | 28 | void Acep_color(unsigned char color); 29 | void EPD_init_Fast(void); 30 | #endif 31 | /*********************************************************** 32 | end file 33 | ***********************************************************/ 34 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Contributions are welcome. Keep It Simple is the Goal. 2 | 3 | ### enhancement suggestions: 4 | - please use the Arduino Forum Displays for questions or enhancement suggestions. 5 | - questions and enhancement suggestions are an important source of inspiration for me. 6 | - the Arduino Forum is my favorite source for learning about displays and processor boards. 7 | - Keep It Simple: I will try to add enhancements to separate classes or subclasses. 8 | 9 | ### issues: 10 | - issues should be reported in the Arduino Forum Displays. 11 | - issues on GitHub are disabled; there were too many false issues. 12 | - please post only issues that are real issues with this library! 13 | 14 | ### pull requests: 15 | - pull requests are not welcome, will not be merged. 16 | - pull requests can't be disabled, but will be closed. 17 | - please place information about interesting fork additions in the Arduino Forum Displays. 18 | 19 | ## Thank you for all the inspiration I get for this library. 20 | -------------------------------------------------------------------------------- /examples/GxEPD2_GFX_Example/TextDisplay.h: -------------------------------------------------------------------------------- 1 | // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // Display Library based on Demo Example from Good Display: https://www.good-display.com/companyfile/32/ 5 | // 6 | // Author: Jean-Marc Zingg 7 | // 8 | // Version: see library.properties 9 | // 10 | // Library: https://github.com/ZinggJM/GxEPD2 11 | // 12 | // Purpose: show uses of GxEPD2_GFX base class for references to a display instance 13 | // 14 | // TextDisplay shows the use of the display instance reference as a function parameter 15 | 16 | #ifndef _TextDisplay_H_ 17 | #define _TextDisplay_H_ 18 | 19 | #include "GxEPD2_GFX.h" 20 | 21 | void helloWorld(GxEPD2_GFX& display); 22 | void helloWorldForDummies(GxEPD2_GFX& display); 23 | void helloFullScreenPartialMode(GxEPD2_GFX& display); 24 | void helloArduino(GxEPD2_GFX& display); 25 | void helloEpaper(GxEPD2_GFX& display); 26 | void helloValue(GxEPD2_GFX& display, double v, int digits); 27 | void showFont(GxEPD2_GFX& display, const char name[], const GFXfont* f); 28 | void drawFont(GxEPD2_GFX& display, const char name[], const GFXfont* f); 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /extras/sw_spi/README.MD: -------------------------------------------------------------------------------- 1 | ### support for SW SPI for GxEPD2 2 | 3 | GxEPD2 supports only HW SPI with the unmodified library. 4 | The replacement files in the src directory provide the option to use SW SPI. 5 | This is a workaround and not very elegant, therefore it is provided as a replacement only. 6 | 7 | To use SW SPI with GxEPD2: 8 | - copy the files GxEPD2_EPD.h and GxEPD2_EPD.cpp from the subdirectoy .src to the .src directory of the library. 9 | - add the special call to the added init method BEFORE the normal init method: 10 | display.epd2.init(SW_SCK, SW_MOSI, 115200, true, 20, false); // define or replace SW_SCK, SW_MOSI 11 | display.init(115200); // needed to init upper level 12 | 13 | To use the modified library with HW SPI 14 | - comment out the special init call: 15 | //display.epd2.init(SW_SCK, SW_MOSI, 115200, true, 20, false); // define or replace SW_SCK, SW_MOSI 16 | display.init(115200); 17 | 18 | To switch back to using HW SPI during run time 19 | display.epd2.init(-1, -1, 115200, true, 20, false); // revert to HW SPI 20 | display.init(115200); // needed to init upper level 21 | 22 | The SW SPI allows also to read through MOSI pin from DIN of e-paper controller 23 | data = display.epd2._readData(); 24 | display.epd2._readData(data, n); -------------------------------------------------------------------------------- /extras/sw_spi/README.txt: -------------------------------------------------------------------------------- 1 | ### support for SW SPI for GxEPD2 2 | 3 | GxEPD2 supports only HW SPI with the unmodified library. 4 | The replacement files in the src directory provide the option to use SW SPI. 5 | This is a workaround and not very elegant, therefore it is provided as a replacement only. 6 | 7 | To use SW SPI with GxEPD2: 8 | - copy the files GxEPD2_EPD.h and GxEPD2_EPD.cpp from the subdirectoy .src to the .src directory of the library. 9 | - add the special call to the added init method BEFORE the normal init method: 10 | display.epd2.init(SW_SCK, SW_MOSI, 115200, true, 20, false); // define or replace SW_SCK, SW_MOSI 11 | display.init(115200); // needed to init upper level 12 | 13 | To use the modified library with HW SPI 14 | - comment out the special init call: 15 | //display.epd2.init(SW_SCK, SW_MOSI, 115200, true, 20, false); // define or replace SW_SCK, SW_MOSI 16 | display.init(115200); 17 | 18 | To switch back to using HW SPI during run time 19 | display.epd2.init(-1, -1, 115200, true, 20, false); // revert to HW SPI 20 | display.init(115200); // needed to init upper level 21 | 22 | The SW SPI allows also to read through MOSI pin from DIN of e-paper controller 23 | data = display.epd2._readData(); 24 | display.epd2._readData(data, n); -------------------------------------------------------------------------------- /examples/GxEPD2_GFX_Example/BitmapDisplay.h: -------------------------------------------------------------------------------- 1 | // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // Display Library based on Demo Example from Good Display: https://www.good-display.com/companyfile/32/ 5 | // 6 | // Author: Jean-Marc Zingg 7 | // 8 | // Version: see library.properties 9 | // 10 | // Library: https://github.com/ZinggJM/GxEPD2 11 | // 12 | // Purpose: show uses of GxEPD2_GFX base class for references to a display instance 13 | // 14 | // BitmapDisplay shows the use of the display instance reference as a class member 15 | 16 | #ifndef _BitmapDisplay_H_ 17 | #define _BitmapDisplay_H_ 18 | 19 | #include "GxEPD2_GFX.h" 20 | 21 | class BitmapDisplay 22 | { 23 | private: 24 | GxEPD2_GFX& display; 25 | public: 26 | BitmapDisplay(GxEPD2_GFX& _display) : display(_display) {}; 27 | void drawBitmaps(); 28 | private: 29 | void drawBitmaps200x200(); 30 | void drawBitmaps104x212(); 31 | void drawBitmaps128x250(); 32 | void drawBitmaps128x296(); 33 | void drawBitmaps152x296(); 34 | void drawBitmaps176x264(); 35 | void drawBitmaps240x416(); 36 | void drawBitmaps400x300(); 37 | void drawBitmaps640x384(); 38 | void drawBitmaps800x480(); 39 | void drawBitmaps800x600(); 40 | void drawBitmaps3c200x200(); 41 | void drawBitmaps3c104x212(); 42 | void drawBitmaps3c128x296(); 43 | void drawBitmaps3c176x264(); 44 | void drawBitmaps3c400x300(); 45 | void drawBitmaps3c800x480(); 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /resources/GDEM0102T91/Display_EPD_W21.h: -------------------------------------------------------------------------------- 1 | #ifndef _DISPLAY_EPD_W21_H_ 2 | #define _DISPLAY_EPD_W21_H_ 3 | 4 | 5 | #define EPD_WIDTH 960 6 | #define EPD_HEIGHT 640 7 | 8 | //EPD 9 | void Epaper_READBUSY(void); 10 | 11 | void Epaper_HW_SW_RESET(void); 12 | void EPD_HW_Init(void); //Electronic paper initialization 13 | void EPD_Update(void); 14 | 15 | void EPD_Part_Init(void);//Local refresh initialization 16 | void EPD_Part_Update(void); 17 | 18 | void EPD_WhiteScreen_White(void); 19 | void EPD_DeepSleep(void); 20 | //Display 21 | void EPD_WhiteScreen_ALL(const unsigned char *datas); 22 | void EPD_SetRAMValue_BaseMap(const unsigned char * datas); 23 | void EPD_Dis_Part(unsigned int x_start,unsigned int y_start,const unsigned char * datas,unsigned int PART_LINE,unsigned int PART_COLUMN); 24 | void EPD_Dis_Part_Time(unsigned int x_startA,unsigned int y_startA,const unsigned char * datasA, 25 | unsigned int x_startB,unsigned int y_startB,const unsigned char * datasB, 26 | unsigned int x_startC,unsigned int y_startC,const unsigned char * datasC, 27 | unsigned int x_startD,unsigned int y_startD,const unsigned char * datasD, 28 | unsigned int x_startE,unsigned int y_startE,const unsigned char * datasE, 29 | unsigned int PART_LINE,unsigned int PART_COLUMN 30 | ); 31 | //Display canvas function 32 | void EPD_WhiteScreen_WhiteBasemap(void); 33 | void Pic_partial_display(const unsigned char *gImage); 34 | 35 | #endif 36 | /*********************************************************** 37 | end file 38 | ***********************************************************/ 39 | -------------------------------------------------------------------------------- /extras/tests/GxEPD2_MinimumExample/GxEPD2_MinimumExample.ino: -------------------------------------------------------------------------------- 1 | // GxEPD2_MinimumExample.ino by Jean-Marc Zingg 2 | 3 | // purpose is e.g. to determine minimum code and ram use by this library 4 | 5 | // see GxEPD2_wiring_examples.h of GxEPD2_Example for wiring suggestions and examples 6 | // if you use a different wiring, you need to adapt the constructor parameters! 7 | 8 | // uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX, to use less code and ram 9 | //#include 10 | 11 | #include // including both doesn't use more code or ram 12 | #include // including both doesn't use more code or ram 13 | #include // same for all three 14 | 15 | // select the display class and display driver class in the following file (new style): 16 | #include "GxEPD2_display_selection_new_style.h" 17 | 18 | // alternately you can copy the constructor from GxEPD2_display_selection.h or GxEPD2_display_selection_added.h of GxEPD2_Example to here 19 | // e.g. for Wemos D1 mini: 20 | //GxEPD2_BW display(GxEPD2_154_D67(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154D67 21 | 22 | void setup() 23 | { 24 | //display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02 25 | display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse 26 | // comment out next line to have no or minimal Adafruit_GFX code 27 | display.setTextColor(GxEPD_BLACK); 28 | display.firstPage(); 29 | do 30 | { 31 | display.fillScreen(GxEPD_WHITE); 32 | // comment out next line to have no or minimal Adafruit_GFX code 33 | display.print("Hello World!"); 34 | } 35 | while (display.nextPage()); 36 | } 37 | 38 | void loop() {}; 39 | -------------------------------------------------------------------------------- /examples/GxEPD2_SD_AVR_Example/GxEPD2_SD_AVR_boards_added.h: -------------------------------------------------------------------------------- 1 | // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // 6 | // Author: Jean-Marc Zingg 7 | // 8 | // Version: see library.properties 9 | // 10 | // Library: https://github.com/ZinggJM/GxEPD2 11 | 12 | // non-AVR board can also be used with GxEPD2 base display classes, e.g. for SD bitmap drawing 13 | 14 | #ifndef _GxEPD2_SD_AVR_boards_added_H_ 15 | #define _GxEPD2_SD_AVR_boards_added_H_ 16 | 17 | #if defined (ESP8266) 18 | #define SD_CS SS // e.g. for RobotDyn Wemos D1 mini SD board 19 | #define EPD_CS D1 // alternative I use with RobotDyn Wemos D1 mini SD board 20 | GxEPD2_DRIVER_CLASS display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4); 21 | #endif 22 | 23 | #if defined(ESP32) 24 | #define SD_CS 2 // adapt to your wiring 25 | #define EPD_CS SS // adapt to your wiring 26 | GxEPD2_DRIVER_CLASS display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4); 27 | #endif 28 | 29 | #if defined(_BOARD_GENERIC_STM32F103C_H_) 30 | #define SD_CS 0 // adapt to your wiring 31 | #define EPD_CS SS // adapt to your wiring 32 | GxEPD2_DRIVER_CLASS display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1); 33 | #endif 34 | 35 | #if defined(ARDUINO_ARCH_SAM) 36 | #define SD_CS 0 // adapt to your wiring 37 | #define EPD_CS SS // adapt to your wiring 38 | GxEPD2_DRIVER_CLASS display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7); 39 | #endif 40 | 41 | #if defined(ARDUINO_ARCH_SAMD) 42 | #define SD_CS 0 // adapt to your wiring 43 | #define EPD_CS SS // adapt to your wiring 44 | GxEPD2_DRIVER_CLASS display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5); 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /examples/GxEPD2_Spiffs_Example/SPIFFS_Support.ino: -------------------------------------------------------------------------------- 1 | #if defined(ESP32) 2 | 3 | #include "FS.h" 4 | 5 | void listDir(fs::FS &fs, const char * dirname, uint8_t levels) { 6 | Serial.printf("Listing directory: %s\r\n", dirname); 7 | 8 | File root = fs.open(dirname); 9 | if (!root) { 10 | Serial.println("- failed to open directory"); 11 | return; 12 | } 13 | if (!root.isDirectory()) { 14 | Serial.println(" - not a directory"); 15 | return; 16 | } 17 | 18 | File file = root.openNextFile(); 19 | while (file) { 20 | if (file.isDirectory()) { 21 | Serial.print(" DIR : "); 22 | Serial.println(file.name()); 23 | if (levels) { 24 | listDir(fs, file.name(), levels - 1); 25 | } 26 | } else { 27 | Serial.print(" FILE: "); 28 | Serial.print(file.name()); 29 | Serial.print("\tSIZE: "); 30 | Serial.println(file.size()); 31 | } 32 | file = root.openNextFile(); 33 | } 34 | } 35 | 36 | void listFiles() 37 | { 38 | listDir(SPIFFS, "/", 0); 39 | } 40 | 41 | #elif defined(ESP8266) 42 | 43 | #include 44 | #include 45 | 46 | /*==================================================================================== 47 | This sketch contains support functions for the ESP6266 LittleFS filing system 48 | 49 | Created by Bodmer 15th Jan 2017 50 | ==================================================================================*/ 51 | 52 | //==================================================================================== 53 | // Print a LittleFS directory list (root directory) 54 | //==================================================================================== 55 | 56 | void listFiles(void) { 57 | Serial.println(); 58 | Serial.println("LittleFS files found:"); 59 | 60 | fs::Dir dir = LittleFS.openDir(""); // Root directory 61 | String line = "====================================="; 62 | uint32_t totalBytes = 0; 63 | 64 | Serial.println(line); 65 | Serial.println(" File name Size"); 66 | Serial.println(line); 67 | 68 | while (dir.next()) { 69 | String fileName = dir.fileName(); 70 | Serial.print(fileName); 71 | int spaces = 25 - fileName.length(); // Tabulate nicely 72 | while (spaces--) Serial.print(" "); 73 | fs::File f = dir.openFile("r"); 74 | Serial.print(f.size()); Serial.println(" bytes"); 75 | totalBytes += f.size(); 76 | } 77 | Serial.println(); Serial.print("Total = "); 78 | int spaces = 25 - 8; // Tabulate nicely 79 | while (spaces--) Serial.print(" "); 80 | Serial.print(totalBytes); Serial.println(" bytes"); 81 | 82 | Serial.println(line); 83 | Serial.println(); 84 | delay(1000); 85 | } 86 | //==================================================================================== 87 | 88 | #else 89 | 90 | void listFiles() 91 | { 92 | Serial.println("LittleFS listFiles() not implemented"); 93 | } 94 | #endif 95 | -------------------------------------------------------------------------------- /examples/GxEPD2_Spiffs_Loader/SPIFFS_Support.ino: -------------------------------------------------------------------------------- 1 | #if defined(ESP32) 2 | 3 | #include "FS.h" 4 | 5 | void listDir(fs::FS &fs, const char * dirname, uint8_t levels) { 6 | Serial.printf("Listing directory: %s\r\n", dirname); 7 | 8 | File root = fs.open(dirname); 9 | if (!root) { 10 | Serial.println("- failed to open directory"); 11 | return; 12 | } 13 | if (!root.isDirectory()) { 14 | Serial.println(" - not a directory"); 15 | return; 16 | } 17 | 18 | File file = root.openNextFile(); 19 | while (file) { 20 | if (file.isDirectory()) { 21 | Serial.print(" DIR : "); 22 | Serial.println(file.name()); 23 | if (levels) { 24 | listDir(fs, file.name(), levels - 1); 25 | } 26 | } else { 27 | Serial.print(" FILE: "); 28 | Serial.print(file.name()); 29 | Serial.print("\tSIZE: "); 30 | Serial.println(file.size()); 31 | } 32 | file = root.openNextFile(); 33 | } 34 | } 35 | 36 | void listFiles() 37 | { 38 | listDir(SPIFFS, "/", 0); 39 | } 40 | 41 | #elif defined(ESP8266) 42 | 43 | #include 44 | #include 45 | 46 | /*==================================================================================== 47 | This sketch contains support functions for the ESP6266 LittleFS filing system 48 | 49 | Created by Bodmer 15th Jan 2017 50 | ==================================================================================*/ 51 | 52 | //==================================================================================== 53 | // Print a LittleFS directory list (root directory) 54 | //==================================================================================== 55 | 56 | void listFiles(void) { 57 | Serial.println(); 58 | Serial.println("LittleFS files found:"); 59 | 60 | fs::Dir dir = LittleFS.openDir(""); // Root directory 61 | String line = "====================================="; 62 | uint32_t totalBytes = 0; 63 | 64 | Serial.println(line); 65 | Serial.println(" File name Size"); 66 | Serial.println(line); 67 | 68 | while (dir.next()) { 69 | String fileName = dir.fileName(); 70 | Serial.print(fileName); 71 | int spaces = 25 - fileName.length(); // Tabulate nicely 72 | while (spaces--) Serial.print(" "); 73 | fs::File f = dir.openFile("r"); 74 | Serial.print(f.size()); Serial.println(" bytes"); 75 | totalBytes += f.size(); 76 | } 77 | Serial.println(); Serial.print("Total = "); 78 | int spaces = 25 - 8; // Tabulate nicely 79 | while (spaces--) Serial.print(" "); 80 | Serial.print(totalBytes); Serial.println(" bytes"); 81 | 82 | Serial.println(line); 83 | Serial.println(); 84 | delay(1000); 85 | } 86 | //==================================================================================== 87 | 88 | #else 89 | 90 | void listFiles() 91 | { 92 | Serial.println("LittleFS listFiles() not implemented"); 93 | } 94 | #endif 95 | -------------------------------------------------------------------------------- /examples/GxEPD2_WiFi_CertStore_Loader/SPIFFS_Support.ino: -------------------------------------------------------------------------------- 1 | #if defined(ESP32) 2 | 3 | #include "FS.h" 4 | 5 | void listDir(fs::FS &fs, const char * dirname, uint8_t levels) { 6 | Serial.printf("Listing directory: %s\r\n", dirname); 7 | 8 | File root = fs.open(dirname); 9 | if (!root) { 10 | Serial.println("- failed to open directory"); 11 | return; 12 | } 13 | if (!root.isDirectory()) { 14 | Serial.println(" - not a directory"); 15 | return; 16 | } 17 | 18 | File file = root.openNextFile(); 19 | while (file) { 20 | if (file.isDirectory()) { 21 | Serial.print(" DIR : "); 22 | Serial.println(file.name()); 23 | if (levels) { 24 | listDir(fs, file.name(), levels - 1); 25 | } 26 | } else { 27 | Serial.print(" FILE: "); 28 | Serial.print(file.name()); 29 | Serial.print("\tSIZE: "); 30 | Serial.println(file.size()); 31 | } 32 | file = root.openNextFile(); 33 | } 34 | } 35 | 36 | void listFiles() 37 | { 38 | listDir(SPIFFS, "/", 0); 39 | } 40 | 41 | #elif defined(ESP8266) 42 | 43 | #include 44 | #include 45 | 46 | /*==================================================================================== 47 | This sketch contains support functions for the ESP6266 LittleFS filing system 48 | 49 | Created by Bodmer 15th Jan 2017 50 | ==================================================================================*/ 51 | 52 | //==================================================================================== 53 | // Print a LittleFS directory list (root directory) 54 | //==================================================================================== 55 | 56 | void listFiles(void) { 57 | Serial.println(); 58 | Serial.println("LittleFS files found:"); 59 | 60 | fs::Dir dir = LittleFS.openDir(""); // Root directory 61 | String line = "====================================="; 62 | uint32_t totalBytes = 0; 63 | 64 | Serial.println(line); 65 | Serial.println(" File name Size"); 66 | Serial.println(line); 67 | 68 | while (dir.next()) { 69 | String fileName = dir.fileName(); 70 | Serial.print(fileName); 71 | int spaces = 25 - fileName.length(); // Tabulate nicely 72 | while (spaces--) Serial.print(" "); 73 | fs::File f = dir.openFile("r"); 74 | Serial.print(f.size()); Serial.println(" bytes"); 75 | totalBytes += f.size(); 76 | } 77 | Serial.println(); Serial.print("Total = "); 78 | int spaces = 25 - 8; // Tabulate nicely 79 | while (spaces--) Serial.print(" "); 80 | Serial.print(totalBytes); Serial.println(" bytes"); 81 | 82 | Serial.println(line); 83 | Serial.println(); 84 | delay(1000); 85 | } 86 | //==================================================================================== 87 | 88 | #else 89 | 90 | void listFiles() 91 | { 92 | Serial.println("LittleFS listFiles() not implemented"); 93 | } 94 | #endif 95 | -------------------------------------------------------------------------------- /examples/GxEPD2_WiFi_CertStore_Loader/update_certs/certs-from-mozilla.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | # This script pulls the list of Mozilla trusted certificate authorities 4 | # from the web at the "mozurl" below, parses the file to grab the PEM 5 | # for each cert, and then generates DER files in a new ./data directory 6 | # Upload these to an on-chip filesystem and use the CertManager to parse 7 | # and use them for your outgoing SSL connections. 8 | # 9 | # Script by Earle F. Philhower, III. Released to the public domain. 10 | from __future__ import print_function 11 | import csv 12 | import os 13 | import sys 14 | from shutil import which 15 | 16 | from subprocess import Popen, PIPE, call 17 | try: 18 | from urllib.request import urlopen 19 | except Exception: 20 | from urllib2 import urlopen 21 | try: 22 | from StringIO import StringIO 23 | except Exception: 24 | from io import StringIO 25 | 26 | # check if ar and openssl are available 27 | if which('ar') is None and not os.path.isfile('./ar') and not os.path.isfile('./ar.exe'): 28 | raise Exception("You need the program 'ar' from xtensa-lx106-elf found here: (esp8266-arduino-core)/tools/xtensa-lx106-elf-gcc/3.0.4-gcc10.3-1757bed/xtensa-lx106-elf/bin/ar") 29 | if which('openssl') is None and not os.path.isfile('./openssl') and not os.path.isfile('./openssl.exe'): 30 | raise Exception("You need to have openssl in PATH, installable e.g. from https://download.firedaemon.com/FireDaemon-OpenSSL/FireDaemon-OpenSSL-x64-3.0.7.exe") 31 | 32 | # Mozilla's URL for the CSV file with included PEM certs 33 | mozurl = "https://ccadb-public.secure.force.com/mozilla/IncludedCACertificateReportPEMCSV" 34 | 35 | # Load the names[] and pems[] array from the URL 36 | names = [] 37 | pems = [] 38 | response = urlopen(mozurl) 39 | csvData = response.read() 40 | if sys.version_info[0] > 2: 41 | csvData = csvData.decode('utf-8') 42 | csvFile = StringIO(csvData) 43 | csvReader = csv.reader(csvFile) 44 | for row in csvReader: 45 | names.append(row[0]+":"+row[1]+":"+row[2]) 46 | for item in row: 47 | if item.startswith("'-----BEGIN CERTIFICATE-----"): 48 | pems.append(item) 49 | del names[0] # Remove headers 50 | del pems[0] # Remove headers 51 | 52 | # Try and make ./data, skip if present 53 | try: 54 | os.mkdir("data") 55 | except Exception: 56 | pass 57 | 58 | derFiles = [] 59 | idx = 0 60 | # Process the text PEM using openssl into DER files 61 | for i in range(0, len(pems)): 62 | certName = "data/ca_%03d.der" % (idx); 63 | thisPem = pems[i].replace("'", "") 64 | print(names[i] + " -> " + certName) 65 | ssl = Popen(['openssl','x509','-inform','PEM','-outform','DER','-out', certName], shell = False, stdin = PIPE) 66 | pipe = ssl.stdin 67 | pipe.write(thisPem.encode('utf-8')) 68 | pipe.close() 69 | ssl.wait() 70 | if os.path.exists(certName): 71 | derFiles.append(certName) 72 | idx = idx + 1 73 | 74 | if os.path.exists("data/certs.ar"): 75 | os.unlink("data/certs.ar"); 76 | 77 | arCmd = ['ar', 'q', 'data/certs.ar'] + derFiles; 78 | call( arCmd ) 79 | 80 | for der in derFiles: 81 | os.unlink(der) 82 | -------------------------------------------------------------------------------- /examples/GxEPD2_HelloWorld/GxEPD2_HelloWorld.ino: -------------------------------------------------------------------------------- 1 | // GxEPD2_HelloWorld.ino by Jean-Marc Zingg 2 | // 3 | // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 4 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 5 | // 6 | // Display Library based on Demo Example from Good Display: https://www.good-display.com/companyfile/32/ 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | // Supporting Arduino Forum Topics (closed, read only): 15 | // Good Display ePaper for Arduino: https://forum.arduino.cc/t/good-display-epaper-for-arduino/419657 16 | // Waveshare e-paper displays with SPI: https://forum.arduino.cc/t/waveshare-e-paper-displays-with-spi/467865 17 | // 18 | // Add new topics in https://forum.arduino.cc/c/using-arduino/displays/23 for new questions and issues 19 | 20 | // see GxEPD2_wiring_examples.h for wiring suggestions and examples 21 | // if you use a different wiring, you need to adapt the constructor parameters! 22 | 23 | // uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX 24 | //#include 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | // select the display class and display driver class in the following file (new style): 33 | #include "GxEPD2_display_selection_new_style.h" 34 | 35 | // or select the display constructor line in one of the following files (old style): 36 | #include "GxEPD2_display_selection.h" 37 | #include "GxEPD2_display_selection_added.h" 38 | 39 | // alternately you can copy the constructor from GxEPD2_display_selection.h or GxEPD2_display_selection_added.h to here 40 | // e.g. for Wemos D1 mini: 41 | //GxEPD2_BW display(GxEPD2_154_D67(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154D67 42 | 43 | // for handling alternative SPI pins (ESP32, RP2040) see example GxEPD2_Example.ino 44 | 45 | void setup() 46 | { 47 | //display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02 48 | display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse 49 | helloWorld(); 50 | display.hibernate(); 51 | } 52 | 53 | const char HelloWorld[] = "Hello World!"; 54 | 55 | void helloWorld() 56 | { 57 | display.setRotation(1); 58 | display.setFont(&FreeMonoBold9pt7b); 59 | display.setTextColor(GxEPD_BLACK); 60 | int16_t tbx, tby; uint16_t tbw, tbh; 61 | display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh); 62 | // center the bounding box by transposition of the origin: 63 | uint16_t x = ((display.width() - tbw) / 2) - tbx; 64 | uint16_t y = ((display.height() - tbh) / 2) - tby; 65 | display.setFullWindow(); 66 | display.firstPage(); 67 | do 68 | { 69 | display.fillScreen(GxEPD_WHITE); 70 | display.setCursor(x, y); 71 | display.print(HelloWorld); 72 | } 73 | while (display.nextPage()); 74 | } 75 | 76 | void loop() {}; 77 | -------------------------------------------------------------------------------- /resources/GDEM0102T91/GDEM0102T91_Arduino.ino: -------------------------------------------------------------------------------- 1 | #include 2 | //EPD 3 | #include "Display_EPD_W21_spi.h" 4 | #include "Display_EPD_W21.h" 5 | #include "Ap_29demo.h" 6 | 7 | void setup() { 8 | pinMode(A14, INPUT); //BUSY 9 | pinMode(A15, OUTPUT); //RES 10 | pinMode(A16, OUTPUT); //DC 11 | pinMode(A17, OUTPUT); //CS 12 | //SPI 13 | SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE0)); 14 | SPI.begin (); 15 | } 16 | 17 | //Tips// 18 | /* 19 | 1.Flickering is normal when EPD is performing a full screen update to clear ghosting from the previous image so to ensure better clarity and legibility for the new image. 20 | 2.There will be no flicker when EPD performs a partial refresh. 21 | 3.Please make sue that EPD enters sleep mode when refresh is completed and always leave the sleep mode command. Otherwise, this may result in a reduced lifespan of EPD. 22 | 4.Please refrain from inserting EPD to the FPC socket or unplugging it when the MCU is being powered to prevent potential damage.) 23 | 5.Re-initialization is required for every full screen update. 24 | 6.When porting the program, set the BUSY pin to input mode and other pins to output mode. 25 | */ 26 | void loop() { 27 | unsigned char i; 28 | 29 | #if 1 //Full screen refresh, fast refresh, and partial refresh demostration. 30 | EPD_HW_Init(); //Full screen refresh initialization. 31 | EPD_WhiteScreen_White(); //Clear screen function. 32 | EPD_DeepSleep(); //Enter the sleep mode and please do not delete it, otherwise it will reduce the lifespan of the screen. 33 | delay(2000); //Delay for 2s. 34 | /************Full display(2s)*******************/ 35 | EPD_HW_Init(); //Full screen refresh initialization. 36 | EPD_WhiteScreen_ALL(gImage_1); //To Display one image using full screen refresh. 37 | EPD_DeepSleep(); //Enter the sleep mode and please do not delete it, otherwise it will reduce the lifespan of the screen. 38 | delay(2000); //Delay for 2s. 39 | 40 | #if 1 //Partial refresh demostration. 41 | //Partial refresh demo support displaying a clock at 5 locations with 00:00. If you need to perform partial refresh more than 5 locations, please use the feature of using partial refresh at the full screen demo. 42 | //After 5 partial refreshes, implement a full screen refresh to clear the ghosting caused by partial refreshes. 43 | //////////////////////Partial refresh time demo///////////////////////////////////// 44 | EPD_HW_Init(); //Electronic paper initialization 45 | EPD_SetRAMValue_BaseMap(gImage_basemap); //Partial refresh background color 46 | for(i=0;i<6;i++) 47 | EPD_Dis_Part_Time( 696+32*1,272,(unsigned char *)&Num[1], //x-A,y-A,DATA-A 48 | 696+32*2,272,(unsigned char *)&Num[0], //x-B,y-B,DATA-B 49 | 696+32*3,272,(unsigned char *)gImage_numdot, //x-C,y-C,DATA-C 50 | 696+32*4,272,(unsigned char *)&Num[0], //x-D,y-D,DATA-D 51 | 696+32*5,272,(unsigned char *)&Num[i],32,64); //x-E,y-E,DATA-E,Resolution 32*64 52 | 53 | EPD_DeepSleep(); //Enter the sleep mode and please do not delete it, otherwise it will reduce the lifespan of the screen. 54 | delay(2000); //Delay for 2s. 55 | EPD_HW_Init(); //Full screen refresh initialization. 56 | EPD_WhiteScreen_White(); //Clear screen function. 57 | EPD_DeepSleep(); //Enter the sleep mode and please do not delete it, otherwise it will reduce the lifespan of the screen. 58 | delay(2000); //Delay for 2s. 59 | #endif 60 | #endif 61 | while(1); // The program stops here 62 | } 63 | 64 | 65 | 66 | 67 | //////////////////////////////////END////////////////////////////////////////////////// 68 | -------------------------------------------------------------------------------- /extras/tests/GxEPD2_MinimumExample/GxEPD2_selection_check.h: -------------------------------------------------------------------------------- 1 | // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // 6 | // Author: Jean-Marc Zingg 7 | // 8 | // Version: see library.properties 9 | // 10 | // Library: https://github.com/ZinggJM/GxEPD2 11 | 12 | // Supporting Arduino Forum Topics: 13 | // Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 14 | // Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 15 | 16 | #define GxEPD2_102_IS_BW true 17 | #define GxEPD2_150_BN_IS_BW true 18 | #define GxEPD2_154_IS_BW true 19 | #define GxEPD2_154_D67_IS_BW true 20 | #define GxEPD2_154_T8_IS_BW true 21 | #define GxEPD2_154_M09_IS_BW true 22 | #define GxEPD2_154_M10_IS_BW true 23 | #define GxEPD2_154_GDEY0154D67_IS_BW true 24 | #define GxEPD2_213_IS_BW true 25 | #define GxEPD2_213_B72_IS_BW true 26 | #define GxEPD2_213_B73_IS_BW true 27 | #define GxEPD2_213_B74_IS_BW true 28 | #define GxEPD2_213_flex_IS_BW true 29 | #define GxEPD2_213_M21_IS_BW true 30 | #define GxEPD2_213_T5D_IS_BW true 31 | #define GxEPD2_213_BN_IS_BW true 32 | #define GxEPD2_213_GDEY0213B74_IS_BW true 33 | #define GxEPD2_260_IS_BW true 34 | #define GxEPD2_260_M01_IS_BW true 35 | #define GxEPD2_266_BN_IS_BW true 36 | #define GxEPD2_266_GDEY0266T90_IS_BW true 37 | #define GxEPD2_270_IS_BW true 38 | #define GxEPD2_270_GDEY027T91_IS_BW true 39 | #define GxEPD2_290_IS_BW true 40 | #define GxEPD2_290_T5_IS_BW true 41 | #define GxEPD2_290_T5D_IS_BW true 42 | #define GxEPD2_290_I6FD_IS_BW true 43 | #define GxEPD2_290_T94_IS_BW true 44 | #define GxEPD2_290_T94_V2_IS_BW true 45 | #define GxEPD2_290_BS_IS_BW true 46 | #define GxEPD2_290_M06_IS_BW true 47 | #define GxEPD2_290_GDEY029T94_IS_BW true 48 | #define GxEPD2_371_IS_BW true 49 | #define GxEPD2_370_TC1_IS_BW true 50 | #define GxEPD2_420_IS_BW true 51 | #define GxEPD2_420_M01_IS_BW true 52 | #define GxEPD2_420_GDEY042T81_IS_BW true 53 | #define GxEPD2_426_GDEQ0426T82_IS_BW true 54 | #define GxEPD2_583_IS_BW true 55 | #define GxEPD2_583_T8_IS_BW true 56 | #define GxEPD2_583_GDEQ0583T31_IS_BW true 57 | #define GxEPD2_750_IS_BW true 58 | #define GxEPD2_750_T7_IS_BW true 59 | #define GxEPD2_750_YT7_IS_BW true 60 | #define GxEPD2_1160_T91_IS_BW true 61 | #define GxEPD2_1248_IS_BW true 62 | #define GxEPD2_it60_IS_BW true 63 | #define GxEPD2_it60_1448x1072_IS_BW true 64 | #define GxEPD2_it78_1872x1404_IS_BW true 65 | #define GxEPD2_it103_1872x1404_IS_BW true 66 | // 3-color e-papers 67 | #define GxEPD2_154c_IS_3C true 68 | #define GxEPD2_154_Z90c_IS_3C true 69 | #define GxEPD2_213c_IS_3C true 70 | #define GxEPD2_213_Z19c_IS_3C true 71 | #define GxEPD2_213_Z98c_IS_3C true 72 | #define GxEPD2_266c_IS_3C true 73 | #define GxEPD2_270c_IS_3C true 74 | #define GxEPD2_290c_IS_3C true 75 | #define GxEPD2_290_Z13c_IS_3C true 76 | #define GxEPD2_290_C90c_IS_3C true 77 | #define GxEPD2_420c_IS_3C true 78 | #define GxEPD2_420c_Z21_IS_3C true 79 | #define GxEPD2_583c_IS_3C true 80 | #define GxEPD2_583c_Z83_IS_3C true 81 | #define GxEPD2_750c_IS_3C true 82 | #define GxEPD2_750c_Z08_IS_3C true 83 | #define GxEPD2_750c_Z90_IS_3C true 84 | #define GxEPD2_1248c_IS_3C true 85 | // 4-color e-paper 86 | #define GxEPD2_266c_GDEY0266F51H_IS_4C true 87 | #define GxEPD2_290c_GDEY029F51H_IS_4C true 88 | #define GxEPD2_300c_IS_4C true 89 | #define GxEPD2_420c_GDEY0420F51_IS_4C true 90 | #define GxEPD2_437c_IS_4C true 91 | // 7-color e-paper 92 | #define GxEPD2_565c_IS_7C true 93 | #define GxEPD2_730c_GDEY073D46_IS_7C true 94 | 95 | #if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) 96 | #define IS_GxEPD2_DRIVER(c, x) (c##x) 97 | #define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) 98 | #define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) 99 | #define IS_GxEPD2_DRIVER_4C(x) IS_GxEPD2_DRIVER(x, _IS_4C) 100 | #define IS_GxEPD2_DRIVER_7C(x) IS_GxEPD2_DRIVER(x, _IS_7C) 101 | #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) 102 | #error "GxEPD2_BW used with 3-color driver class" 103 | #endif 104 | #if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) 105 | #error "GxEPD2_3C used with b/w driver class" 106 | #endif 107 | #if !IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_DRIVER_4C(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_DRIVER_7C(GxEPD2_DRIVER_CLASS) 108 | #error "neither BW nor 3C nor 4C nor 7C kind defined for driver class (error in GxEPD2_selection_check.h)" 109 | #endif 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /extras/tests/GxEPD2_RefreshTests/GxEPD2_selection_check.h: -------------------------------------------------------------------------------- 1 | // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // 6 | // Author: Jean-Marc Zingg 7 | // 8 | // Version: see library.properties 9 | // 10 | // Library: https://github.com/ZinggJM/GxEPD2 11 | 12 | // Supporting Arduino Forum Topics: 13 | // Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 14 | // Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 15 | 16 | #define GxEPD2_102_IS_BW true 17 | #define GxEPD2_150_BN_IS_BW true 18 | #define GxEPD2_154_IS_BW true 19 | #define GxEPD2_154_D67_IS_BW true 20 | #define GxEPD2_154_T8_IS_BW true 21 | #define GxEPD2_154_M09_IS_BW true 22 | #define GxEPD2_154_M10_IS_BW true 23 | #define GxEPD2_154_GDEY0154D67_IS_BW true 24 | #define GxEPD2_213_IS_BW true 25 | #define GxEPD2_213_B72_IS_BW true 26 | #define GxEPD2_213_B73_IS_BW true 27 | #define GxEPD2_213_B74_IS_BW true 28 | #define GxEPD2_213_flex_IS_BW true 29 | #define GxEPD2_213_M21_IS_BW true 30 | #define GxEPD2_213_T5D_IS_BW true 31 | #define GxEPD2_213_BN_IS_BW true 32 | #define GxEPD2_213_GDEY0213B74_IS_BW true 33 | #define GxEPD2_260_IS_BW true 34 | #define GxEPD2_260_M01_IS_BW true 35 | #define GxEPD2_266_BN_IS_BW true 36 | #define GxEPD2_266_GDEY0266T90_IS_BW true 37 | #define GxEPD2_270_IS_BW true 38 | #define GxEPD2_270_GDEY027T91_IS_BW true 39 | #define GxEPD2_290_IS_BW true 40 | #define GxEPD2_290_T5_IS_BW true 41 | #define GxEPD2_290_T5D_IS_BW true 42 | #define GxEPD2_290_I6FD_IS_BW true 43 | #define GxEPD2_290_T94_IS_BW true 44 | #define GxEPD2_290_T94_V2_IS_BW true 45 | #define GxEPD2_290_BS_IS_BW true 46 | #define GxEPD2_290_M06_IS_BW true 47 | #define GxEPD2_290_GDEY029T94_IS_BW true 48 | #define GxEPD2_371_IS_BW true 49 | #define GxEPD2_370_TC1_IS_BW true 50 | #define GxEPD2_420_IS_BW true 51 | #define GxEPD2_420_M01_IS_BW true 52 | #define GxEPD2_420_GDEY042T81_IS_BW true 53 | #define GxEPD2_426_GDEQ0426T82_IS_BW true 54 | #define GxEPD2_583_IS_BW true 55 | #define GxEPD2_583_T8_IS_BW true 56 | #define GxEPD2_583_GDEQ0583T31_IS_BW true 57 | #define GxEPD2_750_IS_BW true 58 | #define GxEPD2_750_T7_IS_BW true 59 | #define GxEPD2_750_YT7_IS_BW true 60 | #define GxEPD2_1160_T91_IS_BW true 61 | #define GxEPD2_1248_IS_BW true 62 | #define GxEPD2_it60_IS_BW true 63 | #define GxEPD2_it60_1448x1072_IS_BW true 64 | #define GxEPD2_it78_1872x1404_IS_BW true 65 | #define GxEPD2_it103_1872x1404_IS_BW true 66 | // 3-color e-papers 67 | #define GxEPD2_154c_IS_3C true 68 | #define GxEPD2_154_Z90c_IS_3C true 69 | #define GxEPD2_213c_IS_3C true 70 | #define GxEPD2_213_Z19c_IS_3C true 71 | #define GxEPD2_213_Z98c_IS_3C true 72 | #define GxEPD2_266c_IS_3C true 73 | #define GxEPD2_270c_IS_3C true 74 | #define GxEPD2_290c_IS_3C true 75 | #define GxEPD2_290_Z13c_IS_3C true 76 | #define GxEPD2_290_C90c_IS_3C true 77 | #define GxEPD2_420c_IS_3C true 78 | #define GxEPD2_420c_Z21_IS_3C true 79 | #define GxEPD2_583c_IS_3C true 80 | #define GxEPD2_583c_Z83_IS_3C true 81 | #define GxEPD2_750c_IS_3C true 82 | #define GxEPD2_750c_Z08_IS_3C true 83 | #define GxEPD2_750c_Z90_IS_3C true 84 | #define GxEPD2_1248c_IS_3C true 85 | // 4-color e-paper 86 | #define GxEPD2_266c_GDEY0266F51H_IS_4C true 87 | #define GxEPD2_290c_GDEY029F51H_IS_4C true 88 | #define GxEPD2_300c_IS_4C true 89 | #define GxEPD2_420c_GDEY0420F51_IS_4C true 90 | #define GxEPD2_437c_IS_4C true 91 | // 7-color e-paper 92 | #define GxEPD2_565c_IS_7C true 93 | #define GxEPD2_730c_GDEY073D46_IS_7C true 94 | 95 | #if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) 96 | #define IS_GxEPD2_DRIVER(c, x) (c##x) 97 | #define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) 98 | #define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) 99 | #define IS_GxEPD2_DRIVER_4C(x) IS_GxEPD2_DRIVER(x, _IS_4C) 100 | #define IS_GxEPD2_DRIVER_7C(x) IS_GxEPD2_DRIVER(x, _IS_7C) 101 | #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) 102 | #error "GxEPD2_BW used with 3-color driver class" 103 | #endif 104 | #if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) 105 | #error "GxEPD2_3C used with b/w driver class" 106 | #endif 107 | #if !IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_DRIVER_4C(GxEPD2_DRIVER_CLASS) && !IS_GxEPD2_DRIVER_7C(GxEPD2_DRIVER_CLASS) 108 | #error "neither BW nor 3C nor 4C nor 7C kind defined for driver class (error in GxEPD2_selection_check.h)" 109 | #endif 110 | 111 | #endif 112 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_750.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL0371 : http://www.good-display.com/download_detail/downloadsId=536.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_750_H_ 14 | #define _GxEPD2_750_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_750 : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 640; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 384; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW075T8; 26 | static const bool hasColor = false; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = false; 29 | static const uint16_t power_on_time = 80; // ms, e.g. 69914us 30 | static const uint16_t power_off_time = 50; // ms, e.g. 40578us 31 | static const uint16_t full_refresh_time = 4500; // ms, e.g. 4273474us 32 | static const uint16_t partial_refresh_time = 4500; // ms, e.g. 4273474us 33 | // constructor 34 | GxEPD2_750(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0x33); // init controller memory and screen (default white) 38 | void writeScreenBuffer(uint8_t value = 0x33); // init controller memory (default white) 39 | // write to controller memory, without screen refresh; x and w should be multiple of 8 40 | 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); 41 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 42 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 43 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 47 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write to controller memory, with screen refresh; x and w should be multiple of 8 49 | 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); 50 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 51 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 56 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 58 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 59 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 60 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 61 | private: 62 | void _send8pixel(uint8_t data); 63 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 64 | void _PowerOn(); 65 | void _PowerOff(); 66 | void _InitDisplay(); 67 | void _Init_Full(); 68 | void _Init_Part(); 69 | void _Update_Full(); 70 | void _Update_Part(); 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_583.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL0371 : http://www.e-paper-display.com/download_detail/downloadsId=536.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_583_H_ 14 | #define _GxEPD2_583_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_583 : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 600; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 448; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW0583T7; 26 | static const bool hasColor = false; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = false; 29 | static const uint16_t power_on_time = 60; // ms, e.g. 56728us 30 | static const uint16_t power_off_time = 30; // ms, e.g. 20291us 31 | static const uint16_t full_refresh_time = 15000; // ms, e.g. 14598868us 32 | static const uint16_t partial_refresh_time = 15000; // ms, e.g. 14598868us 33 | // constructor 34 | GxEPD2_583(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0x33); // init controller memory and screen (default white) 38 | void writeScreenBuffer(uint8_t value = 0x33); // init controller memory (default white) 39 | // write to controller memory, without screen refresh; x and w should be multiple of 8 40 | 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); 41 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 42 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 43 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 47 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write to controller memory, with screen refresh; x and w should be multiple of 8 49 | 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); 50 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 51 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 56 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 58 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 59 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 60 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 61 | private: 62 | void _send8pixel(uint8_t data); 63 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 64 | void _PowerOn(); 65 | void _PowerOff(); 66 | void _InitDisplay(); 67 | void _Init_Full(); 68 | void _Init_Part(); 69 | void _Update_Full(); 70 | void _Update_Part(); 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/GxEPD2.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // Display Library based on Demo Example from Good Display: https://www.good-display.com/companyfile/32/ 5 | // 6 | // Author: Jean-Marc Zingg 7 | // 8 | // Version: see library.properties 9 | // 10 | // Library: https://github.com/ZinggJM/GxEPD2 11 | 12 | #ifndef _GxEPD2_H_ 13 | #define _GxEPD2_H_ 14 | 15 | #include 16 | #include 17 | 18 | // color definitions for GxEPD, GxEPD2 and GxEPD_HD, values correspond to RGB565 values for TFTs 19 | #define GxEPD_BLACK 0x0000 20 | #define GxEPD_WHITE 0xFFFF 21 | // some controllers for b/w EPDs support grey levels 22 | #define GxEPD_DARKGREY 0x7BEF // 128, 128, 128 23 | #define GxEPD_LIGHTGREY 0xC618 // 192, 192, 192 24 | // values for 3-color or 7-color EPDs 25 | #define GxEPD_RED 0xF800 // 255, 0, 0 26 | #define GxEPD_YELLOW 0xFFE0 // 255, 255, 0 !!no longer same as GxEPD_RED!! 27 | #define GxEPD_COLORED GxEPD_RED 28 | // values for 7-color EPDs only 29 | #define GxEPD_BLUE 0x001F // 0, 0, 255 30 | #define GxEPD_GREEN 0x07E0 // 0, 255, 0 31 | #define GxEPD_ORANGE 0xFC00 // 255, 128, 0 32 | 33 | class GxEPD2 34 | { 35 | public: 36 | enum Panel 37 | { 38 | GDEW0102T4, Waveshare_1_02_bw = GDEW0102T4, 39 | GDEP015OC1, Waveshare_1_54_bw = GDEP015OC1, 40 | DEPG0150BN, 41 | GDEH0154D67, Waveshare_1_54_bw_D67 = GDEH0154D67, 42 | GDEW0154T8, 43 | GDEW0154M09, 44 | GDEW0154M10, 45 | GDEY0154D67, 46 | GDE0213B1, Waveshare_2_13_bw = GDE0213B1, 47 | GDEH0213B72, Waveshare_2_13_bw_B72 = GDEH0213B72, 48 | GDEH0213B73, Waveshare_2_13_bw_B73 = GDEH0213B73, 49 | GDEM0213B74, 50 | GDEW0213I5F, Waveshare_2_13_flex = GDEW0213I5F, 51 | GDEW0213M21, 52 | GDEW0213T5D, 53 | DEPG0213BN, 54 | GDEY0213B74, 55 | GDEW026T0, Waveshare_2_6_bw = GDEW026T0, 56 | GDEW026M01, 57 | DEPG0266BN, 58 | GDEY0266T90, 59 | GDEH029A1, Waveshare_2_9_bw = GDEH029A1, 60 | GDEW029T5, Waveshare_2_9_bw_T5 = GDEW029T5, 61 | GDEW029T5D, 62 | GDEW029I6FD, 63 | GDEW029M06, 64 | GDEM029T94, 65 | GDEY029T94, 66 | DEPG0290BS, 67 | GDEY029T71H, 68 | GDEW027W3, Waveshare_2_7_bw = GDEW027W3, 69 | GDEY027T91, 70 | GDEQ031T10, 71 | ED037TC1, 72 | GDEY037T03, 73 | GDEW0371W7, Waveshare_3_7_bw = GDEW0371W7, 74 | GDEM0397T81, 75 | GDEW042T2, Waveshare_4_2_bw = GDEW042T2, 76 | GDEW042M01, 77 | GDEY042T81, 78 | GYE042A87, 79 | SE0420NQ04, 80 | GDEQ0426T82, 81 | GDEY0579T93, 82 | GDEW0583T7, Waveshare_5_83_bw = GDEW0583T7, 83 | GDEW0583T8, 84 | GDEQ0583T31, 85 | GDEW075T8, Waveshare_7_5_bw = GDEW075T8, 86 | GDEW075T7, Waveshare_7_5_bw_T7 = GDEW075T7, 87 | GDEY075T7, 88 | GDEM102T91, 89 | GDEM1085T51, 90 | GDEH116T91, 91 | GDEW1248T3, Waveshare_12_24_bw = GDEW1248T3, 92 | GDEM133T91, 93 | ED060SCT, // on Waveshare IT8951 Driver HAT 94 | ED060KC1, // on Waveshare IT8951 Driver HAT 1448x1072 95 | ED078KC2, // on Waveshare IT8951 Driver HAT 1872x1404 96 | ES103TC1, // on Waveshare IT8951 Driver HAT 1872x1404 97 | // 3-color 98 | GDEW0154Z04, Waveshare_1_54_bwr = GDEW0154Z04, 99 | GDEH0154Z90, Waveshare_1_54_bwr_Z90 = GDEH0154Z90, 100 | GDEW0213Z16, Waveshare_2_13_bwr = GDEW0213Z16, 101 | GDEW0213Z19, 102 | GDEY0213Z98, 103 | GDEW029Z10, Waveshare_2_9_bwr = GDEW029Z10, 104 | GDEH029Z13, 105 | GDEM029C90, 106 | GDEY0266Z90, Waveshare_2_66_bwr = GDEY0266Z90, 107 | GDEW027C44, Waveshare_2_7_bwr = GDEW027C44, 108 | GDEW042Z15, Waveshare_4_2_bwr = GDEW042Z15, 109 | GDEQ042Z21, Waveshare_4_2_V2_bwr = GDEQ042Z21, 110 | GDEY042Z98, 111 | GDEY0579Z93, 112 | GDEQ0583Z31, 113 | GDEW0583Z21, Waveshare_5_83_bwr = GDEW0583Z21, 114 | GDEW0583Z83, 115 | GDEW075Z09, Waveshare_7_5_bwr = GDEW075Z09, 116 | GDEW075Z08, Waveshare_7_5_bwr_Z08 = GDEW075Z08, 117 | GDEH075Z90, Waveshare_7_5_bwr_Z90 = GDEH075Z90, 118 | GDEY116Z91, 119 | GDEY1248Z51, 120 | GDEM133Z91, 121 | // 4-color 122 | GDEY0213F51, 123 | GDEY0266F51H, 124 | GDEY029F51H, 125 | Waveshare3inch4color, 126 | GDEY0420F51, 127 | Waveshare437inch4color, 128 | GDEY0579F51, 129 | GDEM075F52, 130 | GDEY116F51, 131 | // 7-color 132 | ACeP565, Waveshare_5_65_7c = ACeP565, 133 | GDEP0565D90, 134 | GDEY073D46, 135 | ACeP730, Waveshare_7_30_7c = ACeP730, 136 | GDEP073E01, 137 | // Pervasive Displays 138 | E2741FS081, // 7.4" 3-color BWR 139 | E2741CS0B2, // 7.4" B/W 140 | }; 141 | }; 142 | 143 | #endif 144 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_154.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller : IL3829 : http://www.e-paper-display.com/download_detail/downloadsId=534.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_154_H_ 14 | #define _GxEPD2_154_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_154 : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 200; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 200; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEP015OC1; 26 | static const bool hasColor = false; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = true; 29 | static const uint16_t power_on_time = 80; // ms, e.g. 73508us 30 | static const uint16_t power_off_time = 80; // ms, e.g. 68982us 31 | static const uint16_t full_refresh_time = 1200; // ms, e.g. 1113273us 32 | static const uint16_t partial_refresh_time = 300; // ms, e.g. 290867us 33 | // constructor 34 | GxEPD2_154(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 38 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 39 | // write to controller memory, without screen refresh; x and w should be multiple of 8 40 | 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); 41 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 42 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 43 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 47 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write to controller memory, with screen refresh; x and w should be multiple of 8 49 | 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); 50 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 51 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 56 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 58 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 59 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 60 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 61 | private: 62 | void _writeScreenBuffer(uint8_t value); 63 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 64 | void _PowerOn(); 65 | void _PowerOff(); 66 | void _InitDisplay(); 67 | void _Init_Full(); 68 | void _Init_Part(); 69 | void _Update_Full(); 70 | void _Update_Part(); 71 | private: 72 | static const uint8_t LUTDefault_part[]; 73 | static const uint8_t LUTDefault_full[]; 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_290.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL3820 : http://www.e-paper-display.com/download_detail/downloadsId=540.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_290_H_ 14 | #define _GxEPD2_290_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_290 : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 128; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 296; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEH029A1; 26 | static const bool hasColor = false; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = true; 29 | static const uint16_t power_on_time = 80; // ms, e.g. 72498us 30 | static const uint16_t power_off_time = 100; // ms, e.g. 93329us 31 | static const uint16_t full_refresh_time = 1600; // ms, e.g. 1575016us 32 | static const uint16_t partial_refresh_time = 420; // ms, e.g. 412493us 33 | // constructor 34 | GxEPD2_290(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 38 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 39 | // write to controller memory, without screen refresh; x and w should be multiple of 8 40 | 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); 41 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 42 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 43 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 47 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write to controller memory, with screen refresh; x and w should be multiple of 8 49 | 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); 50 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 51 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 56 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 58 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 59 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 60 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 61 | private: 62 | void _writeScreenBuffer(uint8_t value); 63 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 64 | void _PowerOn(); 65 | void _PowerOff(); 66 | void _InitDisplay(); 67 | void _Init_Full(); 68 | void _Init_Part(); 69 | void _Update_Full(); 70 | void _Update_Part(); 71 | private: 72 | static const uint8_t LUTDefault_part[]; 73 | static const uint8_t LUTDefault_full[]; 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_074_E2741CS0B2.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from LaskaKit: https://github.com/LaskaKit/laskakit_epaper 5 | // Panel: E2741CS0B2 (Pervasive Displays 7.4" B/W) 6 | // Controller: Pervasive Displays iTC driver 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | #ifndef _GxEPD2_074_E2741CS0B2_H_ 15 | #define _GxEPD2_074_E2741CS0B2_H_ 16 | 17 | #include "../GxEPD2_EPD.h" 18 | 19 | class GxEPD2_074_E2741CS0B2 : public GxEPD2_EPD 20 | { 21 | public: 22 | // attributes 23 | static const uint16_t WIDTH = 480; 24 | static const uint16_t WIDTH_VISIBLE = WIDTH; 25 | static const uint16_t HEIGHT = 800; 26 | static const GxEPD2::Panel panel = GxEPD2::E2741CS0B2; 27 | static const bool hasColor = false; 28 | static const bool hasPartialUpdate = false; 29 | static const bool hasFastPartialUpdate = false; 30 | static const uint16_t power_on_time = 150; // ms, conservative estimate 31 | static const uint16_t power_off_time = 300; // ms, conservative estimate 32 | static const uint16_t full_refresh_time = 25000; // ms, conservative estimate ~25 seconds for B/W 33 | static const uint16_t partial_refresh_time = 25000; // ms, same as full refresh 34 | // constructor 35 | GxEPD2_074_E2741CS0B2(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 36 | // methods (virtual) 37 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 38 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 39 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 40 | // write to controller memory, without screen refresh; x and w should be multiple of 8 41 | 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); 42 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 43 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 45 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 46 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 48 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 49 | // write to controller memory, with screen refresh; x and w should be multiple of 8 50 | 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); 51 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 52 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 54 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 55 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 57 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 58 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 59 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 60 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 61 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 62 | private: 63 | void _PowerOn(); 64 | void _PowerOff(); 65 | void _InitDisplay(); 66 | void _sendIndexData(uint8_t index, const uint8_t* data, uint16_t len); 67 | void _cogInitialization(); 68 | void _dcDcSoftStart(); 69 | void _displayRefreshAndPowerDown(); 70 | private: 71 | static const uint32_t _frame_size = uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; // 48000 bytes per frame 72 | }; 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /examples/GxEPD2x_FastBlackWhiteOnColor/GxEPD2x_FastBlackWhiteOnColor.ino: -------------------------------------------------------------------------------- 1 | // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // Display Library based on Demo Example from Good Display: https://www.good-display.com/companyfile/32/ 5 | // 6 | // Author: Jean-Marc Zingg 7 | // 8 | // Version: see library.properties 9 | // 10 | // Library: https://github.com/ZinggJM/GxEPD2 11 | 12 | // experimental example GxEPD2x_FastBlackWhiteOnColor.ino: differential refresh on capable 3-color panels 13 | 14 | // see GxEPD2_wiring_examples.h for wiring suggestions and examples 15 | // if you use a different wiring, you need to adapt the constructor parameters! 16 | 17 | // uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX 18 | //#include 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | // e.g. for Wemos D1 mini: 25 | #if defined (ESP8266) 26 | //GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z19 27 | //GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH029Z13 28 | //GxEPD2_3C display(GxEPD2_420c_GDEY042Z98(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEY042Z98 29 | #endif 30 | 31 | #if defined(ESP32) 32 | //GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z19 33 | //GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH029Z13 34 | GxEPD2_3C display(GxEPD2_420c_GDEY042Z98(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY042Z98 35 | #endif 36 | 37 | const uint16_t window_x = 8; 38 | const uint16_t window_y = 10; 39 | const uint16_t window_width = 80; 40 | const uint16_t window_height = 24; 41 | 42 | void setup() 43 | { 44 | Serial.begin(115200); 45 | Serial.println(); 46 | display.init(115200); 47 | helloWorld(); 48 | if (display.epd2.panel == GxEPD2::GDEY042Z98) 49 | { 50 | // the controller SSD1683 of this panel requires old and new data to be equal outside of the partial window 51 | // else it would refresh also outside of the partial window 52 | display.epd2.writeScreenBuffer(0xFF, 0xFF); // both controller buffers set to white 53 | // note that the buffer content is lost by this 54 | } 55 | // make sure window is only b/w, before using fast b/w refreshes 56 | //clearWindow(); // commented out, partial window was cleared by helloWorld() 57 | for (uint16_t i = 0; i < 100; i++) 58 | { 59 | showValue(i); 60 | } 61 | display.hibernate(); 62 | } 63 | 64 | // make sure window is only b/w, before using fast b/w refreshes 65 | void clearWindow() 66 | { 67 | display.setPartialWindow(window_x, window_y, window_width, window_height); 68 | display.firstPage(); 69 | do 70 | { 71 | display.fillScreen(GxEPD_WHITE); 72 | } 73 | while (display.nextPage()); 74 | } 75 | 76 | void showValue(uint16_t value) 77 | { 78 | display.setRotation(0); 79 | display.setFont(&FreeMonoBold9pt7b); 80 | display.setTextColor(GxEPD_BLACK); 81 | if ((1 == display.pages()) && true) // test non-paged 82 | { 83 | display.setFullWindow(); 84 | display.fillRect(window_x, window_y, window_width, window_height, GxEPD_WHITE); 85 | display.setCursor(window_x + 20, window_y + FreeMonoBold9pt7b.yAdvance); 86 | display.print(value); 87 | // non-paged fast bw partial update 88 | display.displayWindowBW(window_x, window_y, window_width, window_height); 89 | } 90 | else // test paged 91 | { 92 | display.setPartialWindow(window_x, window_y, window_width, window_height); 93 | display.firstPage(); 94 | do 95 | { 96 | display.fillScreen(GxEPD_WHITE); 97 | display.setCursor(window_x + 20, window_y + FreeMonoBold9pt7b.yAdvance); 98 | display.print(value); 99 | } 100 | while (display.nextPageBW()); //paged fast bw partial update 101 | } 102 | delay(1000); 103 | } 104 | 105 | const char HelloWorld[] = "Hello World!"; 106 | 107 | void helloWorld() 108 | { 109 | display.setRotation(1); 110 | display.setFont(&FreeMonoBold9pt7b); 111 | display.setTextColor(GxEPD_RED); 112 | int16_t tbx, tby; uint16_t tbw, tbh; 113 | display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh); 114 | // center the bounding box by transposition of the origin: 115 | uint16_t x = ((display.width() - tbw) / 2) - tbx; 116 | uint16_t y = ((display.height() - tbh) / 2) - tby; 117 | display.setFullWindow(); 118 | display.firstPage(); 119 | do 120 | { 121 | display.fillScreen(GxEPD_WHITE); 122 | display.setCursor(x, y); 123 | display.print(HelloWorld); 124 | } 125 | while (display.nextPage()); 126 | } 127 | 128 | void loop() {}; 129 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_154_Z90c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: SSD1682 : https://www.good-display.com/companyfile/203.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_154_Z90c_H_ 14 | #define _GxEPD2_154_Z90c_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_154_Z90c : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 200; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 200; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEH0154Z90; 26 | static const bool hasColor = true; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = false; 29 | static const uint16_t power_on_time = 100; // ms, e.g. 90493us 30 | static const uint16_t power_off_time = 250; // ms, e.g. 230321us 31 | static const uint16_t full_refresh_time = 14000; // ms, e.g. 13608449us 32 | static const uint16_t partial_refresh_time = 14000; // ms, e.g. 13608449us 33 | // constructor 34 | GxEPD2_154_Z90c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 38 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 39 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 40 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 41 | // write to controller memory, without screen refresh; x and w should be multiple of 8 42 | 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); 43 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 44 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 45 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 47 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 49 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 50 | // write to controller memory, with screen refresh; x and w should be multiple of 8 51 | 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); 52 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 53 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 54 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 56 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 58 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 59 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 60 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 61 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 62 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 63 | private: 64 | void _writeScreenBuffer(uint8_t value); 65 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 66 | void _PowerOn(); 67 | void _PowerOff(); 68 | void _InitDisplay(); 69 | void _Init_Full(); 70 | void _Init_Part(); 71 | void _Update_Full(); 72 | void _Update_Part(); 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_290_C90c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: SSD1680 : https://v4.cecdn.yun300.cn/100001_1909185148/SSD1680.pdf 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_290_C90c_H_ 14 | #define _GxEPD2_290_C90c_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_290_C90c : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 128; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 296; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEM029C90; 26 | static const bool hasColor = true; 27 | static const bool hasPartialUpdate = true; // but refresh is full screen 28 | static const bool hasFastPartialUpdate = false; 29 | static const uint16_t power_on_time = 100; // ms, e.g. 94628us 30 | static const uint16_t power_off_time = 150; // ms, e.g. 139874us 31 | static const uint16_t full_refresh_time = 27000; // ms, e.g. 26130024us 32 | static const uint16_t partial_refresh_time = 27000; // ms, e.g. 26130024us 33 | // constructor 34 | GxEPD2_290_C90c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 38 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 39 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 40 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 41 | // write to controller memory, without screen refresh; x and w should be multiple of 8 42 | 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); 43 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 44 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 45 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 47 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 49 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 50 | // write to controller memory, with screen refresh; x and w should be multiple of 8 51 | 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); 52 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 53 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 54 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 56 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 58 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 59 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 60 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 61 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 62 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 63 | private: 64 | void _writeScreenBuffer(uint8_t value); 65 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 66 | void _PowerOn(); 67 | void _PowerOff(); 68 | void _InitDisplay(); 69 | void _Init_Full(); 70 | void _Init_Part(); 71 | void _Update_Full(); 72 | void _Update_Part(); 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_583c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL0371 : http://www.e-paper-display.com/download_detail/downloadsId=536.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2_32 12 | 13 | #ifndef _GxEPD2_583c_H_ 14 | #define _GxEPD2_583c_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_583c : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 600; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 448; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW0583Z21; 26 | static const bool hasColor = true; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = false; 29 | static const uint16_t power_on_time = 70; // ms, e.g. 59769us 30 | static const uint16_t power_off_time = 50; // ms, e.g. 40024us 31 | static const uint16_t full_refresh_time = 32000; // ms, e.g. 29165492us 32 | static const uint16_t partial_refresh_time = 32000; // ms, e.g. 29165492us 33 | // constructor 34 | GxEPD2_583c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0x33); // init controller memory and screen (default white) 38 | void clearScreen(uint8_t black_value, uint8_t red_value); // init controller memory and screen 39 | void writeScreenBuffer(uint8_t value = 0x33); // init controller memory (default white) 40 | void writeScreenBuffer(uint8_t black_value, uint8_t red_value); // init controller memory 41 | // write to controller memory, without screen refresh; x and w should be multiple of 8 42 | 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); 43 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 44 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 45 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 47 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 49 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 50 | // write to controller memory, with screen refresh; x and w should be multiple of 8 51 | 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); 52 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 53 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 54 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 56 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 58 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 59 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 60 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 61 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 62 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 63 | private: 64 | void _writeScreenBuffer(uint8_t value); 65 | void _send8pixel(uint8_t black_data, uint8_t red_data); 66 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 67 | void _PowerOn(); 68 | void _PowerOff(); 69 | void _InitDisplay(); 70 | void _Init_Full(); 71 | void _Init_Part(); 72 | void _Update_Full(); 73 | void _Update_Part(); 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_750c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL0371 : http://www.e-paper-display.com/download_detail/downloadsId=536.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2_32 12 | 13 | #ifndef _GxEPD2_750c_H_ 14 | #define _GxEPD2_750c_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_750c : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 640; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 384; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW075Z09; 26 | static const bool hasColor = true; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = false; 29 | static const uint16_t power_on_time = 50; // ms, e.g. 36540us 30 | static const uint16_t power_off_time = 50; // ms, e.g. 40579us 31 | static const uint16_t full_refresh_time = 32000; // ms, e.g. 31094507us 32 | static const uint16_t partial_refresh_time = 32000; // ms, e.g. 31094507us 33 | // constructor 34 | GxEPD2_750c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0x33); // init controller memory and screen (default white) 38 | void clearScreen(uint8_t black_value, uint8_t red_value); // init controller memory and screen 39 | void writeScreenBuffer(uint8_t value = 0x33); // init controller memory (default white) 40 | void writeScreenBuffer(uint8_t black_value, uint8_t red_value); // init controller memory 41 | // write to controller memory, without screen refresh; x and w should be multiple of 8 42 | 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); 43 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 44 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 45 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 47 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 49 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 50 | // write to controller memory, with screen refresh; x and w should be multiple of 8 51 | 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); 52 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 53 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 54 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 56 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 58 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 59 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 60 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 61 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 62 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 63 | private: 64 | void _writeScreenBuffer(uint8_t value); 65 | void _send8pixel(uint8_t black_data, uint8_t red_data); 66 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 67 | void _PowerOn(); 68 | void _PowerOff(); 69 | void _InitDisplay(); 70 | void _Init_Full(); 71 | void _Init_Part(); 72 | void _Update_Full(); 73 | void _Update_Part(); 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_420c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL0398 : http://www.e-paper-display.com/download_detail/downloadsId=537.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_420c_H_ 14 | #define _GxEPD2_420c_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_420c : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 400; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 300; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW042Z15; 26 | static const bool hasColor = true; 27 | static const bool hasPartialUpdate = true; 28 | static const bool usePartialUpdateWindow = false; // needs be false to work 29 | static const bool hasFastPartialUpdate = false; 30 | static const uint16_t power_on_time = 40; // ms, e.g. 38006us 31 | static const uint16_t power_off_time = 30; // ms, e.g. 20292us 32 | static const uint16_t full_refresh_time = 16000; // ms, e.g. 15771891us 33 | static const uint16_t partial_refresh_time = 16000; // ms, e.g. 15771891us 34 | // constructor 35 | GxEPD2_420c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 36 | // methods (virtual) 37 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 38 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 39 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 40 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 41 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 42 | // write to controller memory, without screen refresh; x and w should be multiple of 8 43 | 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); 44 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 48 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 49 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 50 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 51 | // write to controller memory, with screen refresh; x and w should be multiple of 8 52 | 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); 53 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 57 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 58 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 59 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 60 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 61 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 62 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 63 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 64 | private: 65 | void _writeScreenBuffer(uint8_t value); 66 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 67 | void _PowerOn(); 68 | void _PowerOff(); 69 | void _InitDisplay(); 70 | void _Init_Full(); 71 | void _Init_Part(); 72 | void _Update_Full(); 73 | void _Update_Part(); 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_213c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL0373 : http://www.e-paper-display.com/download_detail/downloadsId=535.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_213c_H_ 14 | #define _GxEPD2_213c_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_213c : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 104; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 212; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW0213Z16; 26 | static const bool hasColor = true; 27 | static const bool hasPartialUpdate = true; 28 | static const bool usePartialUpdateWindow = true; // set false for better image 29 | static const bool hasFastPartialUpdate = false; 30 | static const uint16_t power_on_time = 40; // ms, e.g. 36991us 31 | static const uint16_t power_off_time = 30; // ms, e.g. 20754us 32 | static const uint16_t full_refresh_time = 15000; // ms, e.g. 14896608us 33 | static const uint16_t partial_refresh_time = 15000; // ms, e.g. 14896608us 34 | // constructor 35 | GxEPD2_213c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 36 | // methods (virtual) 37 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 38 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 39 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 40 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 41 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 42 | // write to controller memory, without screen refresh; x and w should be multiple of 8 43 | 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); 44 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 48 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 49 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 50 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 51 | // write to controller memory, with screen refresh; x and w should be multiple of 8 52 | 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); 53 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 57 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 58 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 59 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 60 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 61 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 62 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 63 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 64 | private: 65 | void _writeScreenBuffer(uint8_t value); 66 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 67 | void _PowerOn(); 68 | void _PowerOff(); 69 | void _InitDisplay(); 70 | void _Init_Full(); 71 | void _Init_Part(); 72 | void _Update_Full(); 73 | void _Update_Part(); 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_290c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL0373 : http://www.e-paper-display.com/download_detail/downloadsId=535.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_290c_H_ 14 | #define _GxEPD2_290c_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_290c : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 128; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 296; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW029Z10; 26 | static const bool hasColor = true; 27 | static const bool hasPartialUpdate = true; 28 | static const bool usePartialUpdateWindow = true; // set false for better image 29 | static const bool hasFastPartialUpdate = false; 30 | static const uint16_t power_on_time = 40; // ms, e.g. 36557us 31 | static const uint16_t power_off_time = 30; // ms, e.g. 20291us 32 | static const uint16_t full_refresh_time = 15000; // ms, e.g. 14845408us 33 | static const uint16_t partial_refresh_time = 15000; // ms, e.g. 14845408us 34 | // constructor 35 | GxEPD2_290c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 36 | // methods (virtual) 37 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 38 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 39 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 40 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 41 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 42 | // write to controller memory, without screen refresh; x and w should be multiple of 8 43 | 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); 44 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 48 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 49 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 50 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 51 | // write to controller memory, with screen refresh; x and w should be multiple of 8 52 | 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); 53 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 57 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 58 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 59 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 60 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 61 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 62 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 63 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 64 | private: 65 | void _writeScreenBuffer(uint8_t value); 66 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 67 | void _PowerOn(); 68 | void _PowerOff(); 69 | void _InitDisplay(); 70 | void _Init_Full(); 71 | void _Init_Part(); 72 | void _Update_Full(); 73 | void _Update_Part(); 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_266c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: https://www.good-display.com/comp/xcompanyFile/downloadNew.do?appId=24&fid=1047&id=845 5 | // Panel: GDEY0266Z90 : https://www.good-display.com/product/430.html 6 | // Controller: SSD1680 : https://v4.cecdn.yun300.cn/100001_1909185148/SSD1680.pdf 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | #ifndef _GxEPD2_266c_H_ 15 | #define _GxEPD2_266c_H_ 16 | 17 | #include "../GxEPD2_EPD.h" 18 | 19 | class GxEPD2_266c : public GxEPD2_EPD 20 | { 21 | public: 22 | // attributes 23 | static const uint16_t WIDTH = 152; 24 | static const uint16_t WIDTH_VISIBLE = WIDTH; 25 | static const uint16_t HEIGHT = 296; 26 | static const GxEPD2::Panel panel = GxEPD2::GDEY0266Z90; 27 | static const bool hasColor = true; 28 | static const bool hasPartialUpdate = true; // but refresh is full screen 29 | static const bool hasFastPartialUpdate = false; 30 | static const uint16_t power_on_time = 100; // ms, e.g. 95000us 31 | static const uint16_t power_off_time = 150; // ms, e.g. 140000us 32 | static const uint16_t full_refresh_time = 18000; // ms, e.g. 16882000us 33 | static const uint16_t partial_refresh_time = 18000; // ms, e.g. 16882000us 34 | // constructor 35 | GxEPD2_266c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 36 | // methods (virtual) 37 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 38 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 39 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 40 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 41 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 42 | // write to controller memory, without screen refresh; x and w should be multiple of 8 43 | 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); 44 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 48 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 49 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 50 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 51 | // write to controller memory, with screen refresh; x and w should be multiple of 8 52 | 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); 53 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 57 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 58 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 59 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 60 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 61 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 62 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 63 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 64 | private: 65 | void _writeScreenBuffer(uint8_t value); 66 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 67 | void _PowerOn(); 68 | void _PowerOff(); 69 | void _InitDisplay(); 70 | void _Init_Full(); 71 | void _Init_Part(); 72 | void _Update_Full(); 73 | void _Update_Part(); 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_213.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL3895 : http://www.e-paper-display.com/download_detail/downloadsId=538.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_213_H_ 14 | #define _GxEPD2_213_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_213 : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 128; 23 | static const uint16_t WIDTH_VISIBLE = 122; 24 | static const uint16_t HEIGHT = 250; 25 | static const GxEPD2::Panel panel = GxEPD2::GDE0213B1; 26 | static const bool hasColor = false; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = true; 29 | static const uint16_t power_on_time = 80; // ms, e.g. 72961us 30 | static const uint16_t power_off_time = 140; // ms, e.g. 135839us 31 | static const uint16_t full_refresh_time = 4000; // ms, e.g. 3883686us 32 | static const uint16_t partial_refresh_time = 300; // ms, e.g. 268173us 33 | // constructor 34 | GxEPD2_213(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 38 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 39 | // write to controller memory, without screen refresh; x and w should be multiple of 8 40 | 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); 41 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 42 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 43 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 47 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write to controller memory, with screen refresh; x and w should be multiple of 8 49 | 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); 50 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 51 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 56 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 58 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 59 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 60 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 61 | private: 62 | void _writeScreenBuffer(uint8_t value); 63 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 64 | void _setRamEntryWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 65 | void _setRamArea(uint16_t xs, uint16_t xe, uint16_t ys, uint16_t ye); 66 | void _setRamPointer(uint16_t x, uint16_t y); 67 | void _PowerOn(); 68 | void _PowerOff(); 69 | void _InitDisplay(); 70 | void _Init_Full(); 71 | void _Init_Part(); 72 | void _Update_Full(); 73 | void _Update_Part(); 74 | private: 75 | static const uint8_t LUTDefault_part[]; 76 | static const uint8_t LUTDefault_full[]; 77 | }; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_213_Z98c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Panel: GDEY0213Z98 : https://www.good-display.com/product/392.html 6 | // Controller: SSD1680 : https://v4.cecdn.yun300.cn/100001_1909185148/SSD1680.pdf 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | #ifndef _GxEPD2_213_Z98c_H_ 15 | #define _GxEPD2_213_Z98c_H_ 16 | 17 | #include "../GxEPD2_EPD.h" 18 | 19 | class GxEPD2_213_Z98c : public GxEPD2_EPD 20 | { 21 | public: 22 | // attributes 23 | static const uint16_t WIDTH = 128; 24 | static const uint16_t WIDTH_VISIBLE = 122; 25 | static const uint16_t HEIGHT = 250; 26 | static const GxEPD2::Panel panel = GxEPD2::GDEY0213Z98; 27 | static const bool hasColor = true; 28 | static const bool hasPartialUpdate = true; // but refresh is full screen 29 | static const bool hasFastPartialUpdate = false; 30 | static const uint16_t power_on_time = 100; // ms, e.g. 94682us 31 | static const uint16_t power_off_time = 150; // ms, e.g. 139617us 32 | static const uint16_t full_refresh_time = 15000; // ms, e.g. 14589155us 33 | static const uint16_t partial_refresh_time = 15000; // ms, e.g. 14589155us 34 | // constructor 35 | GxEPD2_213_Z98c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 36 | // methods (virtual) 37 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 38 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 39 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 40 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 41 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 42 | // write to controller memory, without screen refresh; x and w should be multiple of 8 43 | 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); 44 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 48 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 49 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 50 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 51 | // write to controller memory, with screen refresh; x and w should be multiple of 8 52 | 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); 53 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 57 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 58 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 59 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 60 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 61 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 62 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 63 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 64 | private: 65 | void _writeScreenBuffer(uint8_t value); 66 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 67 | void _PowerOn(); 68 | void _PowerOff(); 69 | void _InitDisplay(); 70 | void _Init_Full(); 71 | void _Init_Part(); 72 | void _Update_Full(); 73 | void _Update_Part(); 74 | }; 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /extras/tests/GxEPD2_RefreshTests/GxEPD2_wiring_examples.h: -------------------------------------------------------------------------------- 1 | // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // 6 | // Author: Jean-Marc Zingg 7 | // 8 | // Version: see library.properties 9 | // 10 | // Library: https://github.com/ZinggJM/GxEPD2 11 | 12 | // Supporting Arduino Forum Topics: 13 | // Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 14 | // Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 15 | 16 | // mapping suggestion from Waveshare SPI e-Paper to Wemos D1 mini 17 | // BUSY -> D2, RST -> D4, DC -> D3, CS -> D8, CLK -> D5, DIN -> D7, GND -> GND, 3.3V -> 3.3V 18 | // NOTE: connect 3.3k pull-down from D8 to GND if your board or shield has level converters 19 | // NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, use different pin in case, or 3.3k pull-down 20 | // NOTE: connect 1k pull-up from D4 (RST) to 3.3V if your board or shield has the "clever" reset circuit, or use a different pin 21 | 22 | // mapping suggestion from Waveshare SPI e-Paper to generic ESP8266 23 | // BUSY -> GPIO4, RST -> GPIO2, DC -> GPIO0, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V 24 | // NOTE: connect 3.3k pull-down from GPIO15 to GND if your board or shield has level converters 25 | // NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, use different pin in case, or 3.3k pull-down 26 | // NOTE: connect 1k pull-up from GPIO2 (RST) to 3.3V if your board or shield has the "clever" reset circuit, or use a different pin 27 | 28 | // mapping of Waveshare e-Paper ESP8266 Driver Board, new version 29 | // BUSY -> GPIO5, RST -> GPIO2, DC -> GPIO4, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V 30 | // NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, add a 3.3k pull-down in case 31 | // the e-Paper ESP8266 Driver Board should have no boot mode issue, as it doesn't use level converters 32 | 33 | // mapping of Waveshare e-Paper ESP8266 Driver Board, old version 34 | // BUSY -> GPIO16, RST -> GPIO5, DC -> GPIO4, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V 35 | // NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, add a 3.3k pull-down in case 36 | // the e-Paper ESP8266 Driver Board should have no boot mode issue, as it doesn't use level converters 37 | 38 | // mapping suggestion for ESP32, e.g. LOLIN32, see .../variants/.../pins_arduino.h for your board 39 | // NOTE: there are variants with different pins for SPI ! CHECK SPI PINS OF YOUR BOARD 40 | // BUSY -> 4, RST -> 16, DC -> 17, CS -> SS(5), CLK -> SCK(18), DIN -> MOSI(23), GND -> GND, 3.3V -> 3.3V 41 | 42 | // mapping of Waveshare ESP32 Driver Board 43 | // BUSY -> 25, RST -> 26, DC -> 27, CS-> 15, CLK -> 13, DIN -> 14 44 | // NOTE: this board uses "unusual" SPI pins and requires re-mapping of HW SPI to these pins in SPIClass 45 | // see example GxEPD2_WS_ESP32_Driver.ino, it shows how this can be done easily 46 | 47 | // mapping suggestion for ESP32, e.g. LOLIN32 D32 PRO 48 | // BUSY -> 15, RST -> 2, DC -> 0, CS -> 5, CLK -> SCK(18), DIN -> MOSI(23), GND -> GND, 3.3V -> 3.3V 49 | // note: use explicit value for CS, as SS is re-defined to TF_CS(4) in pins_arduino.h for Board: "LOLIN D32 PRO" 50 | 51 | // mapping suggestion for ESP32, e.g. TTGO T8 ESP32-WROVER 52 | // BUSY -> 4, RST -> 0, DC -> 2, CS -> SS(5), CLK -> SCK(18), DIN -> MOSI(23), GND -> GND, 3.3V -> 3.3V 53 | // for use with Board: "ESP32 Dev Module": 54 | 55 | // new mapping suggestion for STM32F1, e.g. STM32F103C8T6 "BluePill" 56 | // BUSY -> A1, RST -> A2, DC -> A3, CS-> A4, CLK -> A5, DIN -> A7 57 | 58 | // mapping suggestion for AVR, UNO, NANO etc. 59 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 13, DIN -> 11 60 | 61 | // mapping suggestion for AVR, Arduino Micro, Leonardo 62 | // note: on Leonardo board HW SPI pins are on 6-pin ICSP header 63 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 15, DIN -> 16 64 | 65 | // mapping of Waveshare Universal e-Paper Raw Panel Driver Shield for Arduino / NUCLEO 66 | // BUSY -> 7, RST -> 8, DC -> 9, CS-> 10, CLK -> 13, DIN -> 11 67 | 68 | // mapping suggestion for Arduino MEGA 69 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 53, CLK -> 52, DIN -> 51 70 | 71 | // mapping suggestion for Arduino DUE, note: pin 77 is on board pin 10, SS is 10 72 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 76, DIN -> 75 73 | // SPI pins are on 6 pin 2x3 SPI header, no SS on SPI header! 74 | 75 | // mapping suggestion for Arduino MKR1000 or MKRZERO 76 | // note: can't use SS on MKR1000: is defined as 24, should be 4 77 | // BUSY -> 5, RST -> 6, DC -> 7, CS-> 4, CLK -> 9, DIN -> 8 78 | 79 | // mapping suggestion for Arduino Nano RP2040 Connect (Arduino MBED OS Nano Boards) 80 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 13, DIN -> 11 81 | 82 | // mapping suggestion for Raspberry Pi Pico RP2040 (Arduino MBED OS RP2040 Boards) 83 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 5, CLK -> 18, DIN -> 19 84 | 85 | // mapping of my proto board for Raspberry Pi Pico RP2040 (previous default SPI pins) 86 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 5, CLK -> 2, DIN -> 3 87 | -------------------------------------------------------------------------------- /extras/tests/GxEPD2_MinimumExample/GxEPD2_wiring_examples.h: -------------------------------------------------------------------------------- 1 | // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // 6 | // Author: Jean-Marc Zingg 7 | // 8 | // Version: see library.properties 9 | // 10 | // Library: https://github.com/ZinggJM/GxEPD2 11 | 12 | // Supporting Arduino Forum Topics: 13 | // Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 14 | // Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 15 | 16 | // mapping suggestion from Waveshare SPI e-Paper to Wemos D1 mini 17 | // BUSY -> D2, RST -> D4, DC -> D3, CS -> D8, CLK -> D5, DIN -> D7, GND -> GND, 3.3V -> 3.3V 18 | // NOTE: connect 3.3k pull-down from D8 to GND if your board or shield has level converters 19 | // NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, use different pin in case, or 3.3k pull-down 20 | // NOTE: connect 1k pull-up from D4 (RST) to 3.3V if your board or shield has the "clever" reset circuit, or use a different pin 21 | 22 | // mapping suggestion from Waveshare SPI e-Paper to generic ESP8266 23 | // BUSY -> GPIO4, RST -> GPIO2, DC -> GPIO0, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V 24 | // NOTE: connect 3.3k pull-down from GPIO15 to GND if your board or shield has level converters 25 | // NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, use different pin in case, or 3.3k pull-down 26 | // NOTE: connect 1k pull-up from GPIO2 (RST) to 3.3V if your board or shield has the "clever" reset circuit, or use a different pin 27 | 28 | // mapping of Waveshare e-Paper ESP8266 Driver Board, new version 29 | // BUSY -> GPIO5, RST -> GPIO2, DC -> GPIO4, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V 30 | // NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, add a 3.3k pull-down in case 31 | // the e-Paper ESP8266 Driver Board should have no boot mode issue, as it doesn't use level converters 32 | 33 | // mapping of Waveshare e-Paper ESP8266 Driver Board, old version 34 | // BUSY -> GPIO16, RST -> GPIO5, DC -> GPIO4, CS -> GPIO15, CLK -> GPIO14, DIN -> GPIO13, GND -> GND, 3.3V -> 3.3V 35 | // NOTE for ESP8266: using SS (GPIO15) for CS may cause boot mode problems, add a 3.3k pull-down in case 36 | // the e-Paper ESP8266 Driver Board should have no boot mode issue, as it doesn't use level converters 37 | 38 | // mapping suggestion for ESP32, e.g. LOLIN32, see .../variants/.../pins_arduino.h for your board 39 | // NOTE: there are variants with different pins for SPI ! CHECK SPI PINS OF YOUR BOARD 40 | // BUSY -> 4, RST -> 16, DC -> 17, CS -> SS(5), CLK -> SCK(18), DIN -> MOSI(23), GND -> GND, 3.3V -> 3.3V 41 | 42 | // mapping of Waveshare ESP32 Driver Board 43 | // BUSY -> 25, RST -> 26, DC -> 27, CS-> 15, CLK -> 13, DIN -> 14 44 | // NOTE: this board uses "unusual" SPI pins and requires re-mapping of HW SPI to these pins in SPIClass 45 | // see example GxEPD2_WS_ESP32_Driver.ino, it shows how this can be done easily 46 | 47 | // mapping suggestion for ESP32, e.g. LOLIN32 D32 PRO 48 | // BUSY -> 15, RST -> 2, DC -> 0, CS -> 5, CLK -> SCK(18), DIN -> MOSI(23), GND -> GND, 3.3V -> 3.3V 49 | // note: use explicit value for CS, as SS is re-defined to TF_CS(4) in pins_arduino.h for Board: "LOLIN D32 PRO" 50 | 51 | // mapping suggestion for ESP32, e.g. TTGO T8 ESP32-WROVER 52 | // BUSY -> 4, RST -> 0, DC -> 2, CS -> SS(5), CLK -> SCK(18), DIN -> MOSI(23), GND -> GND, 3.3V -> 3.3V 53 | // for use with Board: "ESP32 Dev Module": 54 | 55 | // new mapping suggestion for STM32F1, e.g. STM32F103C8T6 "BluePill" 56 | // BUSY -> A1, RST -> A2, DC -> A3, CS-> A4, CLK -> A5, DIN -> A7 57 | 58 | // mapping suggestion for AVR, UNO, NANO etc. 59 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 13, DIN -> 11 60 | 61 | // mapping suggestion for AVR, Arduino Micro, Leonardo 62 | // note: on Leonardo board HW SPI pins are on 6-pin ICSP header 63 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 15, DIN -> 16 64 | 65 | // mapping of Waveshare Universal e-Paper Raw Panel Driver Shield for Arduino / NUCLEO 66 | // BUSY -> 7, RST -> 8, DC -> 9, CS-> 10, CLK -> 13, DIN -> 11 67 | 68 | // mapping suggestion for Arduino MEGA 69 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 53, CLK -> 52, DIN -> 51 70 | 71 | // mapping suggestion for Arduino DUE, note: pin 77 is on board pin 10, SS is 10 72 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 76, DIN -> 75 73 | // SPI pins are on 6 pin 2x3 SPI header, no SS on SPI header! 74 | 75 | // mapping suggestion for Arduino MKR1000 or MKRZERO 76 | // note: can't use SS on MKR1000: is defined as 24, should be 4 77 | // BUSY -> 5, RST -> 6, DC -> 7, CS-> 4, CLK -> 9, DIN -> 8 78 | 79 | // mapping suggestion for Arduino Nano RP2040 Connect (Arduino MBED OS Nano Boards) 80 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 10, CLK -> 13, DIN -> 11 81 | 82 | // mapping suggestion for Raspberry Pi Pico RP2040 (Arduino MBED OS RP2040 Boards) 83 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 5, CLK -> 18, DIN -> 19 84 | 85 | // mapping of my proto board for Raspberry Pi Pico RP2040 (previous default SPI pins) 86 | // BUSY -> 7, RST -> 9, DC -> 8, CS-> 5, CLK -> 2, DIN -> 3 87 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_290_M06.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: UC8151D : https://www.good-display.com/public/html/pdfjs/viewer/viewernew.html?file=https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_290_M06_H_ 14 | #define _GxEPD2_290_M06_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_290_M06 : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 128; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 296; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW029M06; 26 | static const bool hasColor = false; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = true; // set false for extended temperature range 29 | static const uint16_t power_on_time = 100; // ms, e.g. 83946us 30 | static const uint16_t power_off_time = 50; // ms, e.g. 39163us 31 | static const uint16_t full_refresh_time = 3600; // ms, e.g. 3527448us 32 | static const uint16_t partial_refresh_time = 600; // ms, e.g. 537169us 33 | // constructor 34 | GxEPD2_290_M06(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 38 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 39 | // write to controller memory, without screen refresh; x and w should be multiple of 8 40 | 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); 41 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 42 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 43 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 47 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write to controller memory, with screen refresh; x and w should be multiple of 8 49 | 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); 50 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 51 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 56 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 58 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 59 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 60 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 61 | private: 62 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 63 | void _PowerOn(); 64 | void _PowerOff(); 65 | void _InitDisplay(); 66 | void _Init_Full(); 67 | void _Init_Part(); 68 | void _Update_Full(); 69 | void _Update_Part(); 70 | private: 71 | static const unsigned char lut_20_vcomDC_partial[]; 72 | static const unsigned char lut_21_ww_partial[]; 73 | static const unsigned char lut_22_bw_partial[]; 74 | static const unsigned char lut_23_wb_partial[]; 75 | static const unsigned char lut_24_bb_partial[]; 76 | }; 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /examples/GxEPD2x_MixedTest/GxEPD2x_MixedTest.ino: -------------------------------------------------------------------------------- 1 | // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // Display Library based on Demo Example from Good Display: https://www.good-display.com/companyfile/32/ 5 | // 6 | // Author: Jean-Marc Zingg 7 | // 8 | // Version: see library.properties 9 | // 10 | // Library: https://github.com/ZinggJM/GxEPD2 11 | 12 | // experimental example GxEPD2x_MixedTest.ino: proof of concept for differential refresh on capable 3-color panels 13 | 14 | // see also GxEPD2x_FastBlackWhiteOnColor.ino: differential refresh on capable 3-color panels 15 | 16 | // see GxEPD2_wiring_examples.h for wiring suggestions and examples 17 | // if you use a different wiring, you need to adapt the constructor parameters! 18 | 19 | // uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX 20 | //#include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | // e.g. for Wemos D1 mini: 27 | #if defined (ESP8266) 28 | GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z19 29 | //GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH029Z13 30 | #endif 31 | 32 | #if defined(ESP32) 33 | //GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z19 34 | //GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH029Z13 35 | #endif 36 | 37 | const uint16_t window_x = 8; 38 | const uint16_t window_y = 10; 39 | const uint16_t window_width = 80; 40 | const uint16_t window_height = 24; 41 | 42 | // we need a canvas with correct explicit assignment operator 43 | class MyCanvas1 : public GFXcanvas1 44 | { 45 | private: 46 | uint32_t bytes; 47 | public: 48 | MyCanvas1(uint16_t w, uint16_t h) : GFXcanvas1(w, h), bytes(((w + 7) / 8) * h) {}; 49 | MyCanvas1& operator=(const MyCanvas1& from) 50 | { 51 | if (bytes == from.bytes) 52 | { 53 | memcpy(getBuffer(), from.getBuffer(), bytes); 54 | } // else would need realloc, but buffer is private 55 | return *this; 56 | }; 57 | }; 58 | 59 | //GFXcanvas1 current_bw_window(window_width, window_height); 60 | //GFXcanvas1 previous_bw_window(window_width, window_height); 61 | MyCanvas1 current_bw_window(window_width, window_height); 62 | MyCanvas1 previous_bw_window(window_width, window_height); 63 | 64 | void setup() 65 | { 66 | Serial.begin(115200); 67 | Serial.println(); 68 | display.init(115200); 69 | helloWorld(); 70 | if (current_bw_window.getBuffer() && previous_bw_window.getBuffer()) 71 | { 72 | current_bw_window.fillScreen(GxEPD_WHITE); 73 | previous_bw_window.fillScreen(GxEPD_WHITE); 74 | // only needed if window is not yet white 75 | //display.drawImage(current_bw_window.getBuffer(), previous_bw_window.getBuffer(), window_x, window_y, window_width, window_height); 76 | for (uint16_t i = 0; i < 100; i++) 77 | { 78 | showValue(i); 79 | } 80 | } 81 | else 82 | { 83 | Serial.println("GxEPD2x_MixedTest: canvas buffer allocation failed!"); 84 | Serial.print("current_bw_window 0x"); Serial.println(uint32_t(current_bw_window.getBuffer()), HEX); 85 | Serial.print("previous_bw_window 0x"); Serial.println(uint32_t(previous_bw_window.getBuffer()), HEX); 86 | } 87 | display.hibernate(); 88 | } 89 | 90 | void showValue(uint16_t value) 91 | { 92 | current_bw_window.setFont(&FreeMonoBold9pt7b); 93 | current_bw_window.setTextColor(GxEPD_BLACK); 94 | current_bw_window.fillScreen(GxEPD_WHITE); 95 | current_bw_window.setCursor(20, FreeMonoBold9pt7b.yAdvance); 96 | current_bw_window.print(value); 97 | display.writeImage(previous_bw_window.getBuffer(), current_bw_window.getBuffer(), window_x, window_y, window_width, window_height); 98 | display.epd2.refresh_bw(window_x, window_y, window_width, window_height); 99 | // this needs a canvas with correct explicit assignment operator 100 | previous_bw_window = current_bw_window; 101 | //Serial.print("current_bw_window 0x"); Serial.println(uint32_t(current_bw_window.getBuffer()), HEX); 102 | //Serial.print("previous_bw_window 0x"); Serial.println(uint32_t(previous_bw_window.getBuffer()), HEX); 103 | delay(1000); 104 | } 105 | 106 | const char HelloWorld[] = "Hello World!"; 107 | 108 | void helloWorld() 109 | { 110 | display.setRotation(1); 111 | display.setFont(&FreeMonoBold9pt7b); 112 | display.setTextColor(GxEPD_RED); 113 | int16_t tbx, tby; uint16_t tbw, tbh; 114 | display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh); 115 | // center the bounding box by transposition of the origin: 116 | uint16_t x = ((display.width() - tbw) / 2) - tbx; 117 | uint16_t y = ((display.height() - tbh) / 2) - tby; 118 | display.setFullWindow(); 119 | display.firstPage(); 120 | do 121 | { 122 | display.fillScreen(GxEPD_WHITE); 123 | display.setCursor(x, y); 124 | display.print(HelloWorld); 125 | } 126 | while (display.nextPage()); 127 | } 128 | 129 | void loop() {}; 130 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_420c_Z21.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Panel: GDEQ042Z21 : https://www.good-display.com/product/395.html 6 | // Controller: UC8276 : no link available currently, see https://www.good-display.com/companyfile/5/ 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | #ifndef _GxEPD2_420c_Z21_H_ 15 | #define _GxEPD2_420c_Z21_H_ 16 | 17 | #include "../GxEPD2_EPD.h" 18 | 19 | class GxEPD2_420c_Z21 : public GxEPD2_EPD 20 | { 21 | public: 22 | // attributes 23 | static const uint16_t WIDTH = 400; 24 | static const uint16_t WIDTH_VISIBLE = WIDTH; 25 | static const uint16_t HEIGHT = 300; 26 | static const GxEPD2::Panel panel = GxEPD2::GDEQ042Z21; 27 | static const bool hasColor = true; 28 | static const bool hasPartialUpdate = true; 29 | static const bool usePartialUpdateWindow = true; // works fine on this panel 30 | static const bool hasFastPartialUpdate = false; 31 | static const uint16_t power_on_time = 50; // ms, e.g. 42190us 32 | static const uint16_t power_off_time = 50; // ms, e.g. 39688us 33 | static const uint16_t full_refresh_time = 16000; // ms, e.g. 15171828us 34 | static const uint16_t partial_refresh_time = 16000; // ms, e.g. 15171828us 35 | // constructor 36 | GxEPD2_420c_Z21(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 37 | // methods (virtual) 38 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 39 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 40 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 41 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 42 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 43 | // write to controller memory, without screen refresh; x and w should be multiple of 8 44 | 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); 45 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 46 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 49 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 50 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 51 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | // write to controller memory, with screen refresh; x and w should be multiple of 8 53 | 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); 54 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 55 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 58 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 59 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 60 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 61 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 62 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 63 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 64 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 65 | private: 66 | void _writeScreenBuffer(uint8_t value); 67 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 68 | void _PowerOn(); 69 | void _PowerOff(); 70 | void _InitDisplay(); 71 | void _Init_Full(); 72 | void _Init_Part(); 73 | void _Update_Full(); 74 | void _Update_Part(); 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/epd7c/GxEPD2_565c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_detail/downloadsId=808.html 5 | // Panel: 5.65inch ACeP 7-Color E-Paper : https://www.waveshare.com/product/displays/e-paper/5.65inch-e-paper-module-f.htm 6 | // Controller: unknown 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | #ifndef _GxEPD2_565c_H_ 15 | #define _GxEPD2_565c_H_ 16 | 17 | #include "../GxEPD2_EPD.h" 18 | 19 | class GxEPD2_565c : public GxEPD2_EPD 20 | { 21 | public: 22 | // attributes 23 | static const uint16_t WIDTH = 600; 24 | static const uint16_t WIDTH_VISIBLE = WIDTH; 25 | static const uint16_t HEIGHT = 448; 26 | static const GxEPD2::Panel panel = GxEPD2::ACeP565; 27 | static const bool hasColor = true; 28 | static const bool hasPartialUpdate = false; 29 | static const bool hasFastPartialUpdate = false; 30 | static const uint16_t power_on_time = 100; // ms, e.g. 96001us 31 | static const uint16_t power_off_time = 100; // ms, e.g. 60001us 32 | static const uint16_t full_refresh_time = 12000; // ms, e.g. 11354001us 33 | static const uint16_t partial_refresh_time = 12000; // ms, e.g. 11354001us 34 | // constructor 35 | GxEPD2_565c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 36 | // methods (virtual) 37 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 38 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 39 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 40 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 41 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 42 | // write to controller memory, without screen refresh; x and w should be multiple of 8 43 | 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); 44 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 48 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 49 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 50 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 51 | void writeNativePart(const uint8_t* data1, const uint8_t* data2, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 52 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | // write to controller memory, with screen refresh; x and w should be multiple of 8 54 | 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); 55 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 56 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 58 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 59 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 60 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 61 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 62 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 63 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 64 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 65 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 66 | void setPaged(); // for GxEPD2_154c and GxEPD2_565c paged workaround 67 | private: 68 | void _PowerOn(); 69 | void _PowerOff(); 70 | void _InitDisplay(); 71 | private: 72 | bool _paged; 73 | }; 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_583c_Z83.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: https://www.good-display.com/comp/xcompanyFile/downloadNew.do?appId=24&fid=416&id=164 5 | // Panel: GDEW0583Z83 : https://www.good-display.com/product/242.html 6 | // Controller: GD7965 : http://www.e-paper-display.com/download_detail/downloadsId=821.html 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | #ifndef _GxEPD2_583c_Z83_H_ 15 | #define _GxEPD2_583c_Z83_H_ 16 | 17 | #include "../GxEPD2_EPD.h" 18 | 19 | class GxEPD2_583c_Z83 : public GxEPD2_EPD 20 | { 21 | public: 22 | // attributes 23 | static const uint16_t WIDTH = 648; 24 | static const uint16_t WIDTH_VISIBLE = WIDTH; 25 | static const uint16_t HEIGHT = 480; 26 | static const GxEPD2::Panel panel = GxEPD2::GDEW0583Z83; 27 | static const bool hasColor = true; 28 | static const bool hasPartialUpdate = true; 29 | static const bool usePartialUpdate = true; // set false to get better image (flashes full screen) 30 | static const bool hasFastPartialUpdate = false; 31 | static const uint16_t power_on_time = 150; // ms, e.g. 146001us 32 | static const uint16_t power_off_time = 30; // ms, e.g. 25001us 33 | static const uint16_t full_refresh_time = 23000; // ms, e.g. 22103001us 34 | static const uint16_t partial_refresh_time = 23000; // ms, e.g. 22103001us 35 | // constructor 36 | GxEPD2_583c_Z83(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 37 | // methods (virtual) 38 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 39 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 40 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 41 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 42 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 43 | // write to controller memory, without screen refresh; x and w should be multiple of 8 44 | 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); 45 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 46 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 49 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 50 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 51 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | // write to controller memory, with screen refresh; x and w should be multiple of 8 53 | 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); 54 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 55 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 58 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 59 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 60 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 61 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 62 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 63 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 64 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 65 | private: 66 | void _writeScreenBuffer(uint8_t value); 67 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 68 | void _PowerOn(); 69 | void _PowerOff(); 70 | void _InitDisplay(); 71 | void _Init_Full(); 72 | void _Init_Part(); 73 | void _Update_Full(); 74 | void _Update_Part(); 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_750c_Z08.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_detail/downloadsId=808.html 5 | // Panel: GDEW075Z08 : http://www.e-paper-display.com/products_detail/productId=457.html 6 | // Controller: GD7965 : http://www.e-paper-display.com/download_detail/downloadsId=821.html 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | #ifndef _GxEPD2_750c_Z08_H_ 15 | #define _GxEPD2_750c_Z08_H_ 16 | 17 | #include "../GxEPD2_EPD.h" 18 | 19 | class GxEPD2_750c_Z08 : public GxEPD2_EPD 20 | { 21 | public: 22 | // attributes 23 | static const uint16_t WIDTH = 800; 24 | static const uint16_t WIDTH_VISIBLE = WIDTH; 25 | static const uint16_t HEIGHT = 480; 26 | static const GxEPD2::Panel panel = GxEPD2::GDEW075Z08; 27 | static const bool hasColor = true; 28 | static const bool hasPartialUpdate = true; 29 | static const bool usePartialUpdate = true; // set false to get better image (flashes full screen) 30 | static const bool hasFastPartialUpdate = false; 31 | static const uint16_t power_on_time = 150; // ms, e.g. 133421us 32 | static const uint16_t power_off_time = 30; // ms, e.g. 25362us 33 | static const uint16_t full_refresh_time = 18000; // ms, e.g. 17133490us 34 | static const uint16_t partial_refresh_time = 18000; // ms, e.g. 17133490us 35 | // constructor 36 | GxEPD2_750c_Z08(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 37 | // methods (virtual) 38 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 39 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 40 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 41 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 42 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 43 | // write to controller memory, without screen refresh; x and w should be multiple of 8 44 | 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); 45 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 46 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 49 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 50 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 51 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | // write to controller memory, with screen refresh; x and w should be multiple of 8 53 | 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); 54 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 55 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 58 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 59 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 60 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 61 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 62 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 63 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 64 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 65 | private: 66 | void _writeScreenBuffer(uint8_t value); 67 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 68 | void _PowerOn(); 69 | void _PowerOff(); 70 | void _InitDisplay(); 71 | void _Init_Full(); 72 | void _Init_Part(); 73 | void _Update_Full(); 74 | void _Update_Part(); 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_074c_E2741FS081.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from LaskaKit: https://github.com/LaskaKit/laskakit_epaper 5 | // Panel: E2741FS081 (Pervasive Displays 7.4" 3-color BWR) 6 | // Controller: Pervasive Displays iTC driver 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | #ifndef _GxEPD2_074c_E2741FS081_H_ 15 | #define _GxEPD2_074c_E2741FS081_H_ 16 | 17 | #include "../GxEPD2_EPD.h" 18 | 19 | class GxEPD2_074c_E2741FS081 : public GxEPD2_EPD 20 | { 21 | public: 22 | // attributes 23 | static const uint16_t WIDTH = 480; 24 | static const uint16_t WIDTH_VISIBLE = WIDTH; 25 | static const uint16_t HEIGHT = 800; 26 | static const GxEPD2::Panel panel = GxEPD2::E2741FS081; 27 | static const bool hasColor = true; 28 | static const bool hasPartialUpdate = false; 29 | static const bool hasFastPartialUpdate = false; 30 | static const uint16_t power_on_time = 150; // ms, conservative estimate 31 | static const uint16_t power_off_time = 300; // ms, conservative estimate 32 | static const uint16_t full_refresh_time = 40000; // ms, conservative estimate ~40 seconds for 3-color 33 | static const uint16_t partial_refresh_time = 40000; // ms, same as full refresh 34 | // constructor 35 | GxEPD2_074c_E2741FS081(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 36 | // methods (virtual) 37 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 38 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 39 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 40 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 41 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 42 | // write to controller memory, without screen refresh; x and w should be multiple of 8 43 | 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); 44 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 48 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 49 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 50 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 51 | // write to controller memory, with screen refresh; x and w should be multiple of 8 52 | 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); 53 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 57 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 58 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 59 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 60 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 61 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 62 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 63 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 64 | void setPaged(); // for paged drawing support 65 | private: 66 | void _PowerOn(); 67 | void _PowerOff(); 68 | void _InitDisplay(); 69 | void _sendIndexData(uint8_t index, const uint8_t* data, uint16_t len); 70 | void _cogInitialization(); 71 | void _dcDcSoftStart(); 72 | void _displayRefreshAndPowerDown(); 73 | private: 74 | bool _paged; 75 | static const uint32_t _frame_size = uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; // 48000 bytes per frame 76 | }; 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /examples/GxEPD2_RotaryUsingBusyCallback/BasicEncoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2021 Peter Harrison 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | https://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | ------------------------------------------------------------------------------ 17 | 18 | BasicEncoder provides a class for reading a rotary encoder knob. 19 | It is not suited to motor encoders. 20 | The switch, if present, needs a deparate button library . 21 | 22 | Decoding logic based on https://www.mikrocontroller.net/articles/Drehgeber 23 | */ 24 | 25 | // original source from: https://github.com/micromouseonline/BasicEncoder 26 | // 27 | // adapted for GxEPD2_RotaryUsingBusyCallback.ino example use, without interrupts on any processor 28 | // 29 | // Author: Jean-Marc Zingg 30 | // 31 | // Version: see library.properties 32 | // 33 | // Library: https://github.com/ZinggJM/GxEPD2 34 | 35 | 36 | #ifndef BASIC_ENCODER_H_ 37 | #define BASIC_ENCODER_H_ 38 | 39 | #include 40 | 41 | class BasicEncoder { 42 | public: 43 | BasicEncoder(int8_t pinA, int8_t pinB, uint8_t active_state = LOW, uint8_t steps = 4) 44 | : m_pin_a(pinA), m_pin_b(pinB), m_pin_active(active_state), m_steps_per_count(steps) { 45 | pinMode(pinA, INPUT_PULLUP); 46 | pinMode(pinB, INPUT_PULLUP); 47 | m_change = 0; 48 | } 49 | ~BasicEncoder() {} 50 | 51 | void begin() { 52 | reset(); 53 | } 54 | 55 | int8_t pin_state() { 56 | int8_t state_now = 0; 57 | if (digitalRead(m_pin_a) == m_pin_active) { 58 | state_now |= 2; 59 | } 60 | if (digitalRead(m_pin_b) == m_pin_active) { 61 | state_now |= 1; 62 | } 63 | //if (state_now) Serial.println(state_now); 64 | return state_now; 65 | } 66 | 67 | // to update the encoder changes 68 | // call this method in a timmer interrupt for best performance 69 | // it could also be called in the main loop 70 | // this takes about 10-15us using digitalRead on Arduino Nano 71 | void service() { 72 | int8_t state_now = pin_state(); 73 | state_now ^= state_now >> 1; // two bit gray-to-binary 74 | static int8_t previous_state = state_now; 75 | int8_t difference = previous_state - state_now; 76 | // bit 1 has the direction, bit 0 is set if changeed 77 | if (difference & 1) { 78 | previous_state = state_now; 79 | int delta = (difference & 2) - 1; 80 | if (m_reversed) { 81 | delta = -delta; 82 | } 83 | m_change += delta; 84 | m_steps += delta; 85 | } 86 | } 87 | 88 | /**************************************************************** 89 | 90 | // try this if there are unwanted transitions at the detents 91 | // it is half resolution so counts are doubled 92 | const int8_t decode_table[16] PROGMEM = {0, 0, -2, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, -2, 0, 0}; 93 | void flaky_encoder_service(void) { 94 | // just get the bits - no gray-to-binary conversion needed 95 | int8_t state_now = pin_state(); 96 | static int8_t encoder_state = state_now; 97 | encoder_state = ((encoder_state << 2) | state_now) & 0x0f; 98 | encoder_change += (int8_t)pgm_read_byte(&decode_table[encoder_state]); 99 | } 100 | 101 | ****************************************************************/ 102 | 103 | // Read changes frequently enough that overflows cannot happen. 104 | int8_t get_change() { 105 | //uint8_t sreg = SREG; 106 | //noInterrupts(); 107 | int8_t change = m_change; 108 | // the switch statement can make better code because only optimised 109 | // operations are used instead of generic division 110 | switch (m_steps_per_count) { 111 | case 4: 112 | m_change %= 4; 113 | change /= 4; 114 | break; 115 | case 2: 116 | m_change %= 2; 117 | change /= 2; 118 | break; 119 | default: 120 | m_change = 0; 121 | break; 122 | } 123 | //SREG = sreg; 124 | return change; 125 | } 126 | 127 | int get_count() { 128 | //uint8_t sreg = SREG; 129 | //noInterrupts(); 130 | int count = m_steps / m_steps_per_count; 131 | //SREG = sreg; 132 | return count; 133 | } 134 | 135 | void reset() { 136 | //uint8_t sreg = SREG; 137 | //noInterrupts(); 138 | m_steps = 0; 139 | m_change = 0; 140 | //SREG = sreg; 141 | } 142 | 143 | void set_reverse() { 144 | m_reversed = true; 145 | } 146 | 147 | void set_forward() { 148 | m_reversed = false; 149 | } 150 | 151 | private: 152 | int8_t m_pin_a = 0; 153 | int8_t m_pin_b = 0; 154 | uint8_t m_pin_active = LOW; 155 | uint8_t m_steps_per_count = 4; 156 | bool m_reversed = false; 157 | volatile int m_change = 0; 158 | int m_steps = 0; 159 | }; 160 | #endif // BASIC_ENCODER_H_ 161 | -------------------------------------------------------------------------------- /src/epd3c/GxEPD2_270c.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL91874 : http://www.e-paper-display.com/download_detail/downloadsId=539.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_270c_H_ 14 | #define _GxEPD2_270c_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_270c : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 176; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 264; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW027C44; 26 | static const bool hasColor = true; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = false; 29 | static const uint16_t power_on_time = 20; // ms, e.g. 101361us 30 | static const uint16_t power_off_time = 40; // ms, e.g. 29419us 31 | static const uint16_t full_refresh_time = 16000; // ms, e.g. 15524093us 32 | static const uint16_t partial_refresh_time = 16000; // ms, e.g. 15524093us 33 | // constructor 34 | GxEPD2_270c(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 38 | void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen 39 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 40 | void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory 41 | // write to controller memory, without screen refresh; x and w should be multiple of 8 42 | 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); 43 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 44 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 45 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 47 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 49 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 50 | // write to controller memory, with screen refresh; x and w should be multiple of 8 51 | 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); 52 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 53 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 54 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 56 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 58 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 59 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 60 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 61 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 62 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 63 | private: 64 | void _writeScreenBuffer(uint8_t value); 65 | void _setPartialRamArea_270c(uint8_t cmd, uint16_t x, uint16_t y, uint16_t w, uint16_t h); 66 | void _PowerOn(); 67 | void _PowerOff(); 68 | void _InitDisplay(); 69 | void _Init_Full(); 70 | void _Init_Part(); 71 | void _Update_Full(); 72 | void _Update_Part(); 73 | private: 74 | static const uint8_t lut_20_vcomDC[]; 75 | static const uint8_t lut_21[]; 76 | static const uint8_t lut_22_red[]; 77 | static const uint8_t lut_23_white[]; 78 | static const uint8_t lut_24_black[]; 79 | }; 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_213_M21.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: UC8151 (IL0373) : https://www.good-display.com/public/html/pdfjs/viewer/viewernew.html?file=https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf 6 | // Controller: IL0373 (UC8151) : http://www.e-paper-display.com/download_detail/downloadsId=535.html 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | #ifndef _GxEPD2_213_M21_H_ 15 | #define _GxEPD2_213_M21_H_ 16 | 17 | #include "../GxEPD2_EPD.h" 18 | 19 | class GxEPD2_213_M21 : public GxEPD2_EPD 20 | { 21 | public: 22 | // attributes 23 | static const uint16_t WIDTH = 104; 24 | static const uint16_t WIDTH_VISIBLE = WIDTH; 25 | static const uint16_t HEIGHT = 212; 26 | static const GxEPD2::Panel panel = GxEPD2::GDEW0213M21; 27 | static const bool hasColor = false; 28 | static const bool hasPartialUpdate = true; 29 | static const bool hasFastPartialUpdate = true; // set false for extended temperature range 30 | static const uint16_t power_on_time = 100; // ms, e.g. 68335us 31 | static const uint16_t power_off_time = 50; // ms, e.g. 38676us 32 | static const uint16_t full_refresh_time = 3500; // ms, e.g. 3286491us 33 | static const uint16_t partial_refresh_time = 600; // ms, e.g. 536658us 34 | // constructor 35 | GxEPD2_213_M21(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 36 | // methods (virtual) 37 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 38 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 39 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 40 | // write to controller memory, without screen refresh; x and w should be multiple of 8 41 | 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); 42 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 43 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 45 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 46 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 48 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 49 | // write to controller memory, with screen refresh; x and w should be multiple of 8 50 | 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); 51 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 52 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 54 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 55 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 57 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 58 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 59 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 60 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 61 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 62 | private: 63 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 64 | void _PowerOn(); 65 | void _PowerOff(); 66 | void _InitDisplay(); 67 | void _Init_Full(); 68 | void _Init_Part(); 69 | void _Update_Full(); 70 | void _Update_Part(); 71 | private: 72 | static const unsigned char lut_20_vcomDC_partial[]; 73 | static const unsigned char lut_21_ww_partial[]; 74 | static const unsigned char lut_22_bw_partial[]; 75 | static const unsigned char lut_23_wb_partial[]; 76 | static const unsigned char lut_24_bb_partial[]; 77 | }; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_260_M01.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: UC8151 (IL0373) : https://www.good-display.com/public/html/pdfjs/viewer/viewernew.html?file=https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf 6 | // Controller: IL0373 (UC8151) : http://www.e-paper-display.com/download_detail/downloadsId=535.html 7 | // 8 | // Author: Jean-Marc Zingg 9 | // 10 | // Version: see library.properties 11 | // 12 | // Library: https://github.com/ZinggJM/GxEPD2 13 | 14 | #ifndef _GxEPD2_260_M01_H_ 15 | #define _GxEPD2_260_M01_H_ 16 | 17 | #include "../GxEPD2_EPD.h" 18 | 19 | class GxEPD2_260_M01 : public GxEPD2_EPD 20 | { 21 | public: 22 | // attributes 23 | static const uint16_t WIDTH = 152; 24 | static const uint16_t WIDTH_VISIBLE = WIDTH; 25 | static const uint16_t HEIGHT = 296; 26 | static const GxEPD2::Panel panel = GxEPD2::GDEW026M01; 27 | static const bool hasColor = false; 28 | static const bool hasPartialUpdate = true; 29 | static const bool hasFastPartialUpdate = true; // set false for extended temperature range 30 | static const uint16_t power_on_time = 100; // ms, e.g. 60981us 31 | static const uint16_t power_off_time = 50; // ms, e.g. 39736us 32 | static const uint16_t full_refresh_time = 3400; // ms, e.g. 3308455us 33 | static const uint16_t partial_refresh_time = 1000; // ms, e.g. 938384us 34 | // constructor 35 | GxEPD2_260_M01(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 36 | // methods (virtual) 37 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 38 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 39 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 40 | // write to controller memory, without screen refresh; x and w should be multiple of 8 41 | 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); 42 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 43 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 45 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 46 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 47 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 48 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 49 | // write to controller memory, with screen refresh; x and w should be multiple of 8 50 | 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); 51 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 52 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 54 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 55 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 56 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 57 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 58 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 59 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 60 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 61 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 62 | private: 63 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 64 | void _PowerOn(); 65 | void _PowerOff(); 66 | void _InitDisplay(); 67 | void _Init_Full(); 68 | void _Init_Part(); 69 | void _Update_Full(); 70 | void _Update_Part(); 71 | private: 72 | static const unsigned char lut_20_vcomDC_partial[]; 73 | static const unsigned char lut_21_ww_partial[]; 74 | static const unsigned char lut_22_bw_partial[]; 75 | static const unsigned char lut_23_wb_partial[]; 76 | static const unsigned char lut_24_bb_partial[]; 77 | }; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_213_flex.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL0373 : http://www.e-paper-display.com/download_detail/downloadsId=535.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_213_flex_H_ 14 | #define _GxEPD2_213_flex_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_213_flex : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 104; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 212; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW0213I5F; 26 | static const bool hasColor = false; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = true; 29 | static const uint16_t power_on_time = 400; // ms, e.g. 36553us 30 | static const uint16_t power_off_time = 250; // ms, e.g. 20759us 31 | static const uint16_t full_refresh_time = 2100; // ms, e.g. 2056899us 32 | static const uint16_t partial_refresh_time = 300; // ms, e.g. 283622us 33 | // constructor 34 | GxEPD2_213_flex(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 38 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 39 | // write to controller memory, without screen refresh; x and w should be multiple of 8 40 | 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); 41 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 42 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 43 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 47 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write to controller memory, with screen refresh; x and w should be multiple of 8 49 | 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); 50 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 51 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 56 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 58 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 59 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 60 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 61 | private: 62 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 63 | void _PowerOn(); 64 | void _PowerOff(); 65 | void _InitDisplay(); 66 | void _Init_Full(); 67 | void _Init_Part(); 68 | void _Update_Full(); 69 | void _Update_Part(); 70 | private: 71 | static const unsigned char lut_20_vcomDC[]; 72 | static const unsigned char lut_21_ww[]; 73 | static const unsigned char lut_22_bw[]; 74 | static const unsigned char lut_23_wb[]; 75 | static const unsigned char lut_24_bb[]; 76 | static const unsigned char lut_20_vcomDC_partial[]; 77 | static const unsigned char lut_21_ww_partial[]; 78 | static const unsigned char lut_22_bw_partial[]; 79 | static const unsigned char lut_23_wb_partial[]; 80 | static const unsigned char lut_24_bb_partial[]; 81 | }; 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /src/epd/GxEPD2_290_T5.h: -------------------------------------------------------------------------------- 1 | // Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. 2 | // Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! 3 | // 4 | // based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html 5 | // Controller: IL0373 : http://www.e-paper-display.com/download_detail/downloadsId=535.html 6 | // 7 | // Author: Jean-Marc Zingg 8 | // 9 | // Version: see library.properties 10 | // 11 | // Library: https://github.com/ZinggJM/GxEPD2 12 | 13 | #ifndef _GxEPD2_290_T5_H_ 14 | #define _GxEPD2_290_T5_H_ 15 | 16 | #include "../GxEPD2_EPD.h" 17 | 18 | class GxEPD2_290_T5 : public GxEPD2_EPD 19 | { 20 | public: 21 | // attributes 22 | static const uint16_t WIDTH = 128; 23 | static const uint16_t WIDTH_VISIBLE = WIDTH; 24 | static const uint16_t HEIGHT = 296; 25 | static const GxEPD2::Panel panel = GxEPD2::GDEW029T5; 26 | static const bool hasColor = false; 27 | static const bool hasPartialUpdate = true; 28 | static const bool hasFastPartialUpdate = true; // set this false for test with OTP LUT (GDEW029I6F) 29 | static const uint16_t power_on_time = 400; // ms, e.g. 36553us 30 | static const uint16_t power_off_time = 250; // ms, e.g. 20759us 31 | static const uint16_t full_refresh_time = 2100; // ms, e.g. 2056899us 32 | static const uint16_t partial_refresh_time = 400; // ms, e.g. 353649us 33 | // constructor 34 | GxEPD2_290_T5(int16_t cs, int16_t dc, int16_t rst, int16_t busy); 35 | // methods (virtual) 36 | // Support for Bitmaps (Sprites) to Controller Buffer and to Screen 37 | void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) 38 | void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) 39 | // write to controller memory, without screen refresh; x and w should be multiple of 8 40 | 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); 41 | void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 42 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 43 | void writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 44 | void writeImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 45 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 46 | // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 47 | void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 48 | // write to controller memory, with screen refresh; x and w should be multiple of 8 49 | 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); 50 | void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 51 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 52 | void drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 53 | void drawImagePart(const uint8_t* black, const uint8_t* color, int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, 54 | int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 55 | // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 56 | void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); 57 | void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen 58 | void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen 59 | void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time 60 | void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) 61 | private: 62 | void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 63 | void _PowerOn(); 64 | void _PowerOff(); 65 | void _InitDisplay(); 66 | void _Init_Full(); 67 | void _Init_Part(); 68 | void _Update_Full(); 69 | void _Update_Part(); 70 | private: 71 | static const unsigned char lut_20_vcomDC[]; 72 | static const unsigned char lut_21_ww[]; 73 | static const unsigned char lut_22_bw[]; 74 | static const unsigned char lut_23_wb[]; 75 | static const unsigned char lut_24_bb[]; 76 | static const unsigned char lut_20_vcomDC_partial[]; 77 | static const unsigned char lut_21_ww_partial[]; 78 | static const unsigned char lut_22_bw_partial[]; 79 | static const unsigned char lut_23_wb_partial[]; 80 | static const unsigned char lut_24_bb_partial[]; 81 | }; 82 | 83 | #endif 84 | --------------------------------------------------------------------------------