diff --git a/README.md b/README.md index 932049c..1a78e5d 100644 --- a/README.md +++ b/README.md @@ -62,13 +62,17 @@ - GDEH0213B72 2.13" b/w, replacement for GDE0213B1 - GDEH0213B73 2.13" b/w, new replacement for GDE0213B1, GDEH0213B72 - GDEW0213I5F 2.13" b/w flexible +- GDEW0213T5D 2.13" b/w - GDEW0213M21 2.13" b/w DES - GDEW0213Z16 2.13" b/w/r +- GDEW0213Z19 2.13" b/w/r - GDEH029A1 2.9" b/w - GDEW029T5 2.9" b/w +- GDEW029T5D 2.9" b/w - GDEM029T94 2.9" b/w - GDEW029M06 2.9" b/w DES - GDEW029Z10 2.9" b/w/r +- GDEW029Z13 2.9" b/w/r - GDEM029C90 2.9" b/w/y - GDEW026T0 2.6" b/w - GDEW026M01 2.6" b/w DES @@ -96,7 +100,13 @@ - promotion panels from suppliers are welcome, to add support to GxEPD2 - donation panels from users are welcome, to add support to GxEPD2 -### Version 1.3.1 +### Version 1.3.2 +- added support for GDEW0213T5D 104x212 b/w e-paper panel +- added support for GDEW029T5D 128x296 b/w e-paper panel +- added support for GDEW0213Z19 104x212 b/w/r e-paper panel +- added support for GDEW029Z13 128x296 b/w/r e-paper panel +- both GDEW0213Z19 and GDEW029Z13 support only full screen refresh (controller issue) +#### Version 1.3.1 - added support for GDEM029C90 128x296 b/w/y e-paper panel - GDEM029C90 has a very long refresh time of about 27 seconds - GDEM029C90 has partial update (window addressing) of controller memory diff --git a/examples/GxEPD2_Example/GxEPD2_Example.ino b/examples/GxEPD2_Example/GxEPD2_Example.ino index a0bd890..248525e 100644 --- a/examples/GxEPD2_Example/GxEPD2_Example.ino +++ b/examples/GxEPD2_Example/GxEPD2_Example.ino @@ -104,6 +104,7 @@ void setup() // effective if display panel hasFastPartialUpdate helloFullScreenPartialMode(); delay(1000); + //stripeTest(); return; // GDEH029Z13 issue helloArduino(); delay(1000); helloEpaper(); @@ -332,6 +333,40 @@ void helloEpaper() //Serial.println("helloEpaper done"); } +// test partial window issue on GDEW0213Z19 and GDEH029Z13 +void stripeTest() +{ + helloStripe(104); + delay(2000); + helloStripe(96); +} + +const char HelloStripe[] = "Hello Stripe!"; + +void helloStripe(uint16_t pw_xe) // end of partial window in physcal x direction +{ + //Serial.print("HelloStripe("); Serial.print(pw_xe); Serial.println(")"); + display.setRotation(3); + display.setFont(&FreeMonoBold9pt7b); + display.setTextColor(display.epd2.hasColor ? GxEPD_RED : GxEPD_BLACK); + int16_t tbx, tby; uint16_t tbw, tbh; + display.getTextBounds(HelloStripe, 0, 0, &tbx, &tby, &tbw, &tbh); + uint16_t wh = FreeMonoBold9pt7b.yAdvance; + uint16_t wy = pw_xe - wh; + uint16_t x = ((display.width() - tbw) / 2) - tbx; + uint16_t y = wy - tby; + display.setPartialWindow(0, wy, display.width(), wh); + display.firstPage(); + do + { + display.fillScreen(GxEPD_WHITE); + display.setCursor(x, y); + display.print(HelloStripe); + } + while (display.nextPage()); + //Serial.println("HelloStripe done"); +} + #if defined(ESP8266) || defined(ESP32) #include #define PrintString StreamString diff --git a/examples/GxEPD2_Example/GxEPD2_display_selection.h b/examples/GxEPD2_Example/GxEPD2_display_selection.h index 19c3a75..1d8f95c 100644 --- a/examples/GxEPD2_Example/GxEPD2_display_selection.h +++ b/examples/GxEPD2_Example/GxEPD2_display_selection.h @@ -25,8 +25,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW026T0 @@ -44,7 +46,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW027C44 // can use only half buffer size @@ -75,8 +79,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW026T0 @@ -94,7 +100,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW027C44 // can use only half buffer size @@ -120,8 +128,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW026T0 @@ -138,7 +148,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW042Z15 @@ -178,8 +190,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW026T0 @@ -197,7 +211,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW042Z15 @@ -228,8 +244,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026T0 @@ -247,7 +265,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042Z15 @@ -275,8 +295,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW026T0 @@ -294,7 +316,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW042Z15 diff --git a/examples/GxEPD2_Example/GxEPD2_display_selection_added.h b/examples/GxEPD2_Example/GxEPD2_display_selection_added.h index b4fb1d1..e6fe3d7 100644 --- a/examples/GxEPD2_Example/GxEPD2_display_selection_added.h +++ b/examples/GxEPD2_Example/GxEPD2_display_selection_added.h @@ -32,8 +32,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_BW display(GxEPD2_270(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); @@ -49,7 +51,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_420c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); @@ -87,8 +91,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_BW display(GxEPD2_270(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); @@ -104,7 +110,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); @@ -138,8 +146,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_BW display(GxEPD2_270(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); @@ -154,7 +164,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); @@ -187,8 +199,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_BW display(GxEPD2_270(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); @@ -203,7 +217,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); @@ -237,8 +253,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); //GxEPD2_BW display(GxEPD2_270(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); @@ -254,7 +272,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // can use only half buffer size diff --git a/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h index ad9a171..527cfc2 100644 --- a/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_Example/GxEPD2_display_selection_new_style.h @@ -27,10 +27,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -47,7 +49,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 @@ -80,6 +84,8 @@ #define IS_GxEPD2_7C(x) IS_GxEPD(GxEPD2_7C_IS_, x) #define IS_GxEPD2_1248(x) IS_GxEPD(GxEPD2_1248_IS_, x) +#include "GxEPD2_selection_check.h" + #if defined (ESP8266) #define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) diff --git a/examples/GxEPD2_Example/GxEPD2_selection_check.h b/examples/GxEPD2_Example/GxEPD2_selection_check.h new file mode 100644 index 0000000..d2b8d33 --- /dev/null +++ b/examples/GxEPD2_Example/GxEPD2_selection_check.h @@ -0,0 +1,71 @@ +// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! +// +// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +// Supporting Arduino Forum Topics: +// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 +// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 + +#define GxEPD2_154_IS_BW true +#define GxEPD2_154_D67_IS_BW true +#define GxEPD2_154_T8_IS_BW true +#define GxEPD2_154_M09_IS_BW true +#define GxEPD2_154_M10_IS_BW true +#define GxEPD2_213_IS_BW true +#define GxEPD2_213_B72_IS_BW true +#define GxEPD2_213_B73_IS_BW true +#define GxEPD2_213_flex_IS_BW true +#define GxEPD2_213_M21_IS_BW true +#define GxEPD2_213_T5D_IS_BW true +#define GxEPD2_290_IS_BW true +#define GxEPD2_290_T5_IS_BW true +#define GxEPD2_290_T5D_IS_BW true +#define GxEPD2_290_T94_IS_BW true +#define GxEPD2_290_M06_IS_BW true +#define GxEPD2_260_IS_BW true +#define GxEPD2_260_M01_IS_BW true +#define GxEPD2_270_IS_BW true +#define GxEPD2_371_IS_BW true +#define GxEPD2_420_IS_BW true +#define GxEPD2_420_M01_IS_BW true +#define GxEPD2_583_IS_BW true +#define GxEPD2_583_T8_IS_BW true +#define GxEPD2_750_IS_BW true +#define GxEPD2_750_T7_IS_BW true +// 3-color e-papers +#define GxEPD2_154c_IS_3C true +#define GxEPD2_154_Z90c_IS_3C true +#define GxEPD2_213c_IS_3C true +#define GxEPD2_213_Z19c_IS_3C true +#define GxEPD2_290c_IS_3C true +#define GxEPD2_290_Z13c_IS_3C true +#define GxEPD2_290_C90c_IS_3C true +#define GxEPD2_270c_IS_3C true +#define GxEPD2_420c_IS_3C true +#define GxEPD2_583c_IS_3C true +#define GxEPD2_750c_IS_3C true +#define GxEPD2_750c_Z08_IS_3C true +#define GxEPD2_750c_Z90_IS_3C true +#define GxEPD2_1248_IS_3C true +// 7-color e-paper +#define GxEPD2_565c_IS_7C true + +#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) +#define IS_GxEPD2_DRIVER(c, x) (c##x) +#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) +#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_BW used with 3-color driver class" +#endif +#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_3C used with b/w driver class" +#endif + +#endif diff --git a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection.h b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection.h index 19c3a75..1d8f95c 100644 --- a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection.h +++ b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection.h @@ -25,8 +25,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW026T0 @@ -44,7 +46,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW027C44 // can use only half buffer size @@ -75,8 +79,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW026T0 @@ -94,7 +100,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW027C44 // can use only half buffer size @@ -120,8 +128,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW026T0 @@ -138,7 +148,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW042Z15 @@ -178,8 +190,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW026T0 @@ -197,7 +211,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW042Z15 @@ -228,8 +244,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026T0 @@ -247,7 +265,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042Z15 @@ -275,8 +295,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW026T0 @@ -294,7 +316,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW042Z15 diff --git a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_added.h b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_added.h index b4fb1d1..e6fe3d7 100644 --- a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_added.h +++ b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_added.h @@ -32,8 +32,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_BW display(GxEPD2_270(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); @@ -49,7 +51,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_420c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); @@ -87,8 +91,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_BW display(GxEPD2_270(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); @@ -104,7 +110,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); @@ -138,8 +146,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_BW display(GxEPD2_270(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); @@ -154,7 +164,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); @@ -187,8 +199,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_BW display(GxEPD2_270(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); @@ -203,7 +217,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); @@ -237,8 +253,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); //GxEPD2_BW display(GxEPD2_270(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); @@ -254,7 +272,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // can use only half buffer size diff --git a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_new_style.h index ad9a171..527cfc2 100644 --- a/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_GFX_Example/GxEPD2_display_selection_new_style.h @@ -27,10 +27,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -47,7 +49,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 @@ -80,6 +84,8 @@ #define IS_GxEPD2_7C(x) IS_GxEPD(GxEPD2_7C_IS_, x) #define IS_GxEPD2_1248(x) IS_GxEPD(GxEPD2_1248_IS_, x) +#include "GxEPD2_selection_check.h" + #if defined (ESP8266) #define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) diff --git a/examples/GxEPD2_GFX_Example/GxEPD2_selection_check.h b/examples/GxEPD2_GFX_Example/GxEPD2_selection_check.h new file mode 100644 index 0000000..d2b8d33 --- /dev/null +++ b/examples/GxEPD2_GFX_Example/GxEPD2_selection_check.h @@ -0,0 +1,71 @@ +// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! +// +// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +// Supporting Arduino Forum Topics: +// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 +// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 + +#define GxEPD2_154_IS_BW true +#define GxEPD2_154_D67_IS_BW true +#define GxEPD2_154_T8_IS_BW true +#define GxEPD2_154_M09_IS_BW true +#define GxEPD2_154_M10_IS_BW true +#define GxEPD2_213_IS_BW true +#define GxEPD2_213_B72_IS_BW true +#define GxEPD2_213_B73_IS_BW true +#define GxEPD2_213_flex_IS_BW true +#define GxEPD2_213_M21_IS_BW true +#define GxEPD2_213_T5D_IS_BW true +#define GxEPD2_290_IS_BW true +#define GxEPD2_290_T5_IS_BW true +#define GxEPD2_290_T5D_IS_BW true +#define GxEPD2_290_T94_IS_BW true +#define GxEPD2_290_M06_IS_BW true +#define GxEPD2_260_IS_BW true +#define GxEPD2_260_M01_IS_BW true +#define GxEPD2_270_IS_BW true +#define GxEPD2_371_IS_BW true +#define GxEPD2_420_IS_BW true +#define GxEPD2_420_M01_IS_BW true +#define GxEPD2_583_IS_BW true +#define GxEPD2_583_T8_IS_BW true +#define GxEPD2_750_IS_BW true +#define GxEPD2_750_T7_IS_BW true +// 3-color e-papers +#define GxEPD2_154c_IS_3C true +#define GxEPD2_154_Z90c_IS_3C true +#define GxEPD2_213c_IS_3C true +#define GxEPD2_213_Z19c_IS_3C true +#define GxEPD2_290c_IS_3C true +#define GxEPD2_290_Z13c_IS_3C true +#define GxEPD2_290_C90c_IS_3C true +#define GxEPD2_270c_IS_3C true +#define GxEPD2_420c_IS_3C true +#define GxEPD2_583c_IS_3C true +#define GxEPD2_750c_IS_3C true +#define GxEPD2_750c_Z08_IS_3C true +#define GxEPD2_750c_Z90_IS_3C true +#define GxEPD2_1248_IS_3C true +// 7-color e-paper +#define GxEPD2_565c_IS_7C true + +#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) +#define IS_GxEPD2_DRIVER(c, x) (c##x) +#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) +#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_BW used with 3-color driver class" +#endif +#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_3C used with b/w driver class" +#endif + +#endif diff --git a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection.h b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection.h index 19c3a75..1d8f95c 100644 --- a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection.h +++ b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection.h @@ -25,8 +25,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW026T0 @@ -44,7 +46,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW027C44 // can use only half buffer size @@ -75,8 +79,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW026T0 @@ -94,7 +100,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW027C44 // can use only half buffer size @@ -120,8 +128,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW026T0 @@ -138,7 +148,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW042Z15 @@ -178,8 +190,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW026T0 @@ -197,7 +211,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ SS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1)); // GDEW042Z15 @@ -228,8 +244,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW026T0 @@ -247,7 +265,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW042Z15 @@ -275,8 +295,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH029A1 //GxEPD2_BW display(GxEPD2_290_T5(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_T94(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEM029T94 //GxEPD2_BW display(GxEPD2_290_M06(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW026T0 @@ -294,7 +316,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213Z16 +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW029Z10 +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW027C44 //GxEPD2_3C display(GxEPD2_420c(/*CS=10*/ SS, /*DC=*/ 9, /*RST=*/ 8, /*BUSY=*/ 7)); // GDEW042Z15 diff --git a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_added.h b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_added.h index b4fb1d1..e6fe3d7 100644 --- a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_added.h +++ b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_added.h @@ -32,8 +32,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_BW display(GxEPD2_270(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); @@ -49,7 +51,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); //GxEPD2_3C display(GxEPD2_420c(/*CS=77*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7)); @@ -87,8 +91,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_BW display(GxEPD2_270(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); @@ -104,7 +110,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); //GxEPD2_3C display(GxEPD2_420c(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5)); @@ -138,8 +146,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_BW display(GxEPD2_270(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); @@ -154,7 +164,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 15)); @@ -187,8 +199,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_BW display(GxEPD2_270(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); @@ -203,7 +217,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); //GxEPD2_3C display(GxEPD2_420c(/*CS=5*/ 5, /*DC=*/ 2, /*RST=*/ 0, /*BUSY=*/ 4)); @@ -237,8 +253,10 @@ //GxEPD2_BW display(GxEPD2_213_B73(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213T5D //GxEPD2_BW display(GxEPD2_290(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); //GxEPD2_BW display(GxEPD2_270(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); @@ -254,7 +272,9 @@ //GxEPD2_3C display(GxEPD2_154c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEH029Z13 //GxEPD2_3C display(GxEPD2_290_C90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=5*/ 5, /*BUSY=16*/ 16)); // can use only half buffer size diff --git a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h index ad9a171..527cfc2 100644 --- a/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_HelloWorld/GxEPD2_display_selection_new_style.h @@ -27,10 +27,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -47,7 +49,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 @@ -80,6 +84,8 @@ #define IS_GxEPD2_7C(x) IS_GxEPD(GxEPD2_7C_IS_, x) #define IS_GxEPD2_1248(x) IS_GxEPD(GxEPD2_1248_IS_, x) +#include "GxEPD2_selection_check.h" + #if defined (ESP8266) #define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) diff --git a/examples/GxEPD2_HelloWorld/GxEPD2_selection_check.h b/examples/GxEPD2_HelloWorld/GxEPD2_selection_check.h new file mode 100644 index 0000000..d2b8d33 --- /dev/null +++ b/examples/GxEPD2_HelloWorld/GxEPD2_selection_check.h @@ -0,0 +1,71 @@ +// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! +// +// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +// Supporting Arduino Forum Topics: +// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 +// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 + +#define GxEPD2_154_IS_BW true +#define GxEPD2_154_D67_IS_BW true +#define GxEPD2_154_T8_IS_BW true +#define GxEPD2_154_M09_IS_BW true +#define GxEPD2_154_M10_IS_BW true +#define GxEPD2_213_IS_BW true +#define GxEPD2_213_B72_IS_BW true +#define GxEPD2_213_B73_IS_BW true +#define GxEPD2_213_flex_IS_BW true +#define GxEPD2_213_M21_IS_BW true +#define GxEPD2_213_T5D_IS_BW true +#define GxEPD2_290_IS_BW true +#define GxEPD2_290_T5_IS_BW true +#define GxEPD2_290_T5D_IS_BW true +#define GxEPD2_290_T94_IS_BW true +#define GxEPD2_290_M06_IS_BW true +#define GxEPD2_260_IS_BW true +#define GxEPD2_260_M01_IS_BW true +#define GxEPD2_270_IS_BW true +#define GxEPD2_371_IS_BW true +#define GxEPD2_420_IS_BW true +#define GxEPD2_420_M01_IS_BW true +#define GxEPD2_583_IS_BW true +#define GxEPD2_583_T8_IS_BW true +#define GxEPD2_750_IS_BW true +#define GxEPD2_750_T7_IS_BW true +// 3-color e-papers +#define GxEPD2_154c_IS_3C true +#define GxEPD2_154_Z90c_IS_3C true +#define GxEPD2_213c_IS_3C true +#define GxEPD2_213_Z19c_IS_3C true +#define GxEPD2_290c_IS_3C true +#define GxEPD2_290_Z13c_IS_3C true +#define GxEPD2_290_C90c_IS_3C true +#define GxEPD2_270c_IS_3C true +#define GxEPD2_420c_IS_3C true +#define GxEPD2_583c_IS_3C true +#define GxEPD2_750c_IS_3C true +#define GxEPD2_750c_Z08_IS_3C true +#define GxEPD2_750c_Z90_IS_3C true +#define GxEPD2_1248_IS_3C true +// 7-color e-paper +#define GxEPD2_565c_IS_7C true + +#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) +#define IS_GxEPD2_DRIVER(c, x) (c##x) +#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) +#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_BW used with 3-color driver class" +#endif +#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_3C used with b/w driver class" +#endif + +#endif diff --git a/examples/GxEPD2_MinimumExample/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_MinimumExample/GxEPD2_display_selection_new_style.h index ad9a171..527cfc2 100644 --- a/examples/GxEPD2_MinimumExample/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_MinimumExample/GxEPD2_display_selection_new_style.h @@ -27,10 +27,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -47,7 +49,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 @@ -80,6 +84,8 @@ #define IS_GxEPD2_7C(x) IS_GxEPD(GxEPD2_7C_IS_, x) #define IS_GxEPD2_1248(x) IS_GxEPD(GxEPD2_1248_IS_, x) +#include "GxEPD2_selection_check.h" + #if defined (ESP8266) #define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) diff --git a/examples/GxEPD2_MinimumExample/GxEPD2_selection_check.h b/examples/GxEPD2_MinimumExample/GxEPD2_selection_check.h new file mode 100644 index 0000000..d2b8d33 --- /dev/null +++ b/examples/GxEPD2_MinimumExample/GxEPD2_selection_check.h @@ -0,0 +1,71 @@ +// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! +// +// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +// Supporting Arduino Forum Topics: +// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 +// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 + +#define GxEPD2_154_IS_BW true +#define GxEPD2_154_D67_IS_BW true +#define GxEPD2_154_T8_IS_BW true +#define GxEPD2_154_M09_IS_BW true +#define GxEPD2_154_M10_IS_BW true +#define GxEPD2_213_IS_BW true +#define GxEPD2_213_B72_IS_BW true +#define GxEPD2_213_B73_IS_BW true +#define GxEPD2_213_flex_IS_BW true +#define GxEPD2_213_M21_IS_BW true +#define GxEPD2_213_T5D_IS_BW true +#define GxEPD2_290_IS_BW true +#define GxEPD2_290_T5_IS_BW true +#define GxEPD2_290_T5D_IS_BW true +#define GxEPD2_290_T94_IS_BW true +#define GxEPD2_290_M06_IS_BW true +#define GxEPD2_260_IS_BW true +#define GxEPD2_260_M01_IS_BW true +#define GxEPD2_270_IS_BW true +#define GxEPD2_371_IS_BW true +#define GxEPD2_420_IS_BW true +#define GxEPD2_420_M01_IS_BW true +#define GxEPD2_583_IS_BW true +#define GxEPD2_583_T8_IS_BW true +#define GxEPD2_750_IS_BW true +#define GxEPD2_750_T7_IS_BW true +// 3-color e-papers +#define GxEPD2_154c_IS_3C true +#define GxEPD2_154_Z90c_IS_3C true +#define GxEPD2_213c_IS_3C true +#define GxEPD2_213_Z19c_IS_3C true +#define GxEPD2_290c_IS_3C true +#define GxEPD2_290_Z13c_IS_3C true +#define GxEPD2_290_C90c_IS_3C true +#define GxEPD2_270c_IS_3C true +#define GxEPD2_420c_IS_3C true +#define GxEPD2_583c_IS_3C true +#define GxEPD2_750c_IS_3C true +#define GxEPD2_750c_Z08_IS_3C true +#define GxEPD2_750c_Z90_IS_3C true +#define GxEPD2_1248_IS_3C true +// 7-color e-paper +#define GxEPD2_565c_IS_7C true + +#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) +#define IS_GxEPD2_DRIVER(c, x) (c##x) +#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) +#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_BW used with 3-color driver class" +#endif +#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_3C used with b/w driver class" +#endif + +#endif diff --git a/examples/GxEPD2_MultiDisplayExample/GxEPD2_MultiDisplayExample.ino b/examples/GxEPD2_MultiDisplayExample/GxEPD2_MultiDisplayExample.ino index d066b2f..4135909 100644 --- a/examples/GxEPD2_MultiDisplayExample/GxEPD2_MultiDisplayExample.ino +++ b/examples/GxEPD2_MultiDisplayExample/GxEPD2_MultiDisplayExample.ino @@ -82,8 +82,10 @@ GxEPD2_BW display2(GxEPD2_213(/*CS=*/ CS_2, /*DC //GxEPD2_BW display(GxEPD2_213_B73(/*CS=*/ CS_1, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=*/ CS_1, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=*/ CS_1, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(/*CS=*/ CS_1, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW0213T5D GxEPD2_BW display3(GxEPD2_290(/*CS=*/ CS_3, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=*/ CS_1, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=*/ CS_1, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=*/ CS_1, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); //GxEPD2_BW display(GxEPD2_270(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); @@ -99,7 +101,10 @@ GxEPD2_BW display3(GxEPD2_290(/*CS=*/ CS_3, /*DC //GxEPD2_3C display(GxEPD2_154c(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // GDEH029Z13 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // can use only half buffer size //GxEPD2_3C display(GxEPD2_420c(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); @@ -130,8 +135,10 @@ GxEPD2_BW display2(GxEPD2_213(/*CS=*/ CS_2, /*DC //GxEPD2_BW display(GxEPD2_213_B73(/*CS=*/ CS_2, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEH0213B73 //GxEPD2_BW display(GxEPD2_213_flex(/*CS=*/ CS_2, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW0213I5F //GxEPD2_BW display(GxEPD2_213_M21(/*CS=*/ CS_2, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW0213M21 +//GxEPD2_BW display(GxEPD2_213_T5D(//*CS=*/ CS_2, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW0213T5D GxEPD2_BW display3(GxEPD2_290(/*CS=*/ CS_3, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); //GxEPD2_BW display(GxEPD2_290_T5(/*CS=*/ CS_1, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW029T5 +//GxEPD2_BW display(GxEPD2_290_T5D(/*CS=*/ CS_2, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW029T5D //GxEPD2_BW display(GxEPD2_290_M06(/*CS=*/ CS_2, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_H_x)); // GDEW029M06 //GxEPD2_BW display(GxEPD2_260(/*CS=*/ CS_x, /*DC=D3*/ 0, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); //GxEPD2_BW display(GxEPD2_270(/*CS=*/ CS_x, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); @@ -146,7 +153,10 @@ GxEPD2_BW display3(GxEPD2_290(/*CS=*/ CS_3, /*DC //GxEPD2_3C display(GxEPD2_154c(/*CS=*/ CS_x, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // GDEW0154Z04 no longer available //GxEPD2_3C display(GxEPD2_154_Z90c(/*CS=*/ CS_x, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // GDEH0154Z90 //GxEPD2_3C display(GxEPD2_213c(/*CS=*/ CS_x, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); +//GxEPD2_3C display(GxEPD2_213_Z19c(/*CS=*/ CS_x, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // GDEW0213Z19 //GxEPD2_3C display(GxEPD2_290c(/*CS=*/ CS_x, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); +//GxEPD2_3C display(GxEPD2_290_Z13c(/*CS=*/ CS_x, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // GDEH029Z13 +//GxEPD2_3C display(GxEPD2_290_C90c(/*CS=*/ CS_x, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); // GDEM029C90 //GxEPD2_3C display(GxEPD2_270c(/*CS=*/ CS_x, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); //GxEPD2_3C display(GxEPD2_420c(/*CS=*/ CS_x, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); GxEPD2_3C display4(GxEPD2_750c(/*CS=*/ CS_4, /*DC=*/ 17, /*RST=*/ -1, /*BUSY=*/ BUSY_L_x)); diff --git a/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h index ad9a171..527cfc2 100644 --- a/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_NotPagedExample/GxEPD2_display_selection_new_style.h @@ -27,10 +27,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -47,7 +49,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 @@ -80,6 +84,8 @@ #define IS_GxEPD2_7C(x) IS_GxEPD(GxEPD2_7C_IS_, x) #define IS_GxEPD2_1248(x) IS_GxEPD(GxEPD2_1248_IS_, x) +#include "GxEPD2_selection_check.h" + #if defined (ESP8266) #define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) diff --git a/examples/GxEPD2_NotPagedExample/GxEPD2_selection_check.h b/examples/GxEPD2_NotPagedExample/GxEPD2_selection_check.h new file mode 100644 index 0000000..d2b8d33 --- /dev/null +++ b/examples/GxEPD2_NotPagedExample/GxEPD2_selection_check.h @@ -0,0 +1,71 @@ +// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! +// +// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +// Supporting Arduino Forum Topics: +// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 +// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 + +#define GxEPD2_154_IS_BW true +#define GxEPD2_154_D67_IS_BW true +#define GxEPD2_154_T8_IS_BW true +#define GxEPD2_154_M09_IS_BW true +#define GxEPD2_154_M10_IS_BW true +#define GxEPD2_213_IS_BW true +#define GxEPD2_213_B72_IS_BW true +#define GxEPD2_213_B73_IS_BW true +#define GxEPD2_213_flex_IS_BW true +#define GxEPD2_213_M21_IS_BW true +#define GxEPD2_213_T5D_IS_BW true +#define GxEPD2_290_IS_BW true +#define GxEPD2_290_T5_IS_BW true +#define GxEPD2_290_T5D_IS_BW true +#define GxEPD2_290_T94_IS_BW true +#define GxEPD2_290_M06_IS_BW true +#define GxEPD2_260_IS_BW true +#define GxEPD2_260_M01_IS_BW true +#define GxEPD2_270_IS_BW true +#define GxEPD2_371_IS_BW true +#define GxEPD2_420_IS_BW true +#define GxEPD2_420_M01_IS_BW true +#define GxEPD2_583_IS_BW true +#define GxEPD2_583_T8_IS_BW true +#define GxEPD2_750_IS_BW true +#define GxEPD2_750_T7_IS_BW true +// 3-color e-papers +#define GxEPD2_154c_IS_3C true +#define GxEPD2_154_Z90c_IS_3C true +#define GxEPD2_213c_IS_3C true +#define GxEPD2_213_Z19c_IS_3C true +#define GxEPD2_290c_IS_3C true +#define GxEPD2_290_Z13c_IS_3C true +#define GxEPD2_290_C90c_IS_3C true +#define GxEPD2_270c_IS_3C true +#define GxEPD2_420c_IS_3C true +#define GxEPD2_583c_IS_3C true +#define GxEPD2_750c_IS_3C true +#define GxEPD2_750c_Z08_IS_3C true +#define GxEPD2_750c_Z90_IS_3C true +#define GxEPD2_1248_IS_3C true +// 7-color e-paper +#define GxEPD2_565c_IS_7C true + +#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) +#define IS_GxEPD2_DRIVER(c, x) (c##x) +#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) +#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_BW used with 3-color driver class" +#endif +#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_3C used with b/w driver class" +#endif + +#endif diff --git a/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h index ad9a171..527cfc2 100644 --- a/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_display_selection_new_style.h @@ -27,10 +27,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -47,7 +49,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 @@ -80,6 +84,8 @@ #define IS_GxEPD2_7C(x) IS_GxEPD(GxEPD2_7C_IS_, x) #define IS_GxEPD2_1248(x) IS_GxEPD(GxEPD2_1248_IS_, x) +#include "GxEPD2_selection_check.h" + #if defined (ESP8266) #define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) diff --git a/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_selection_check.h b/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_selection_check.h new file mode 100644 index 0000000..d2b8d33 --- /dev/null +++ b/examples/GxEPD2_PagedDisplayUsingCallback/GxEPD2_selection_check.h @@ -0,0 +1,71 @@ +// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! +// +// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +// Supporting Arduino Forum Topics: +// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 +// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 + +#define GxEPD2_154_IS_BW true +#define GxEPD2_154_D67_IS_BW true +#define GxEPD2_154_T8_IS_BW true +#define GxEPD2_154_M09_IS_BW true +#define GxEPD2_154_M10_IS_BW true +#define GxEPD2_213_IS_BW true +#define GxEPD2_213_B72_IS_BW true +#define GxEPD2_213_B73_IS_BW true +#define GxEPD2_213_flex_IS_BW true +#define GxEPD2_213_M21_IS_BW true +#define GxEPD2_213_T5D_IS_BW true +#define GxEPD2_290_IS_BW true +#define GxEPD2_290_T5_IS_BW true +#define GxEPD2_290_T5D_IS_BW true +#define GxEPD2_290_T94_IS_BW true +#define GxEPD2_290_M06_IS_BW true +#define GxEPD2_260_IS_BW true +#define GxEPD2_260_M01_IS_BW true +#define GxEPD2_270_IS_BW true +#define GxEPD2_371_IS_BW true +#define GxEPD2_420_IS_BW true +#define GxEPD2_420_M01_IS_BW true +#define GxEPD2_583_IS_BW true +#define GxEPD2_583_T8_IS_BW true +#define GxEPD2_750_IS_BW true +#define GxEPD2_750_T7_IS_BW true +// 3-color e-papers +#define GxEPD2_154c_IS_3C true +#define GxEPD2_154_Z90c_IS_3C true +#define GxEPD2_213c_IS_3C true +#define GxEPD2_213_Z19c_IS_3C true +#define GxEPD2_290c_IS_3C true +#define GxEPD2_290_Z13c_IS_3C true +#define GxEPD2_290_C90c_IS_3C true +#define GxEPD2_270c_IS_3C true +#define GxEPD2_420c_IS_3C true +#define GxEPD2_583c_IS_3C true +#define GxEPD2_750c_IS_3C true +#define GxEPD2_750c_Z08_IS_3C true +#define GxEPD2_750c_Z90_IS_3C true +#define GxEPD2_1248_IS_3C true +// 7-color e-paper +#define GxEPD2_565c_IS_7C true + +#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) +#define IS_GxEPD2_DRIVER(c, x) (c##x) +#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) +#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_BW used with 3-color driver class" +#endif +#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_3C used with b/w driver class" +#endif + +#endif diff --git a/examples/GxEPD2_SD_AVR_Example/GxEPD2_SD_AVR_Example.ino b/examples/GxEPD2_SD_AVR_Example/GxEPD2_SD_AVR_Example.ino index d585779..6f160bc 100644 --- a/examples/GxEPD2_SD_AVR_Example/GxEPD2_SD_AVR_Example.ino +++ b/examples/GxEPD2_SD_AVR_Example/GxEPD2_SD_AVR_Example.ino @@ -58,10 +58,12 @@ SdFat SD; //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -77,7 +79,9 @@ SdFat SD; //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 //#define GxEPD2_DRIVER_CLASS GxEPD2_583c // GDEW0583Z21 600x448 diff --git a/examples/GxEPD2_SD_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_SD_Example/GxEPD2_display_selection_new_style.h index ad9a171..527cfc2 100644 --- a/examples/GxEPD2_SD_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_SD_Example/GxEPD2_display_selection_new_style.h @@ -27,10 +27,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -47,7 +49,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 @@ -80,6 +84,8 @@ #define IS_GxEPD2_7C(x) IS_GxEPD(GxEPD2_7C_IS_, x) #define IS_GxEPD2_1248(x) IS_GxEPD(GxEPD2_1248_IS_, x) +#include "GxEPD2_selection_check.h" + #if defined (ESP8266) #define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) diff --git a/examples/GxEPD2_SD_Example/GxEPD2_selection_check.h b/examples/GxEPD2_SD_Example/GxEPD2_selection_check.h new file mode 100644 index 0000000..d2b8d33 --- /dev/null +++ b/examples/GxEPD2_SD_Example/GxEPD2_selection_check.h @@ -0,0 +1,71 @@ +// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! +// +// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +// Supporting Arduino Forum Topics: +// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 +// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 + +#define GxEPD2_154_IS_BW true +#define GxEPD2_154_D67_IS_BW true +#define GxEPD2_154_T8_IS_BW true +#define GxEPD2_154_M09_IS_BW true +#define GxEPD2_154_M10_IS_BW true +#define GxEPD2_213_IS_BW true +#define GxEPD2_213_B72_IS_BW true +#define GxEPD2_213_B73_IS_BW true +#define GxEPD2_213_flex_IS_BW true +#define GxEPD2_213_M21_IS_BW true +#define GxEPD2_213_T5D_IS_BW true +#define GxEPD2_290_IS_BW true +#define GxEPD2_290_T5_IS_BW true +#define GxEPD2_290_T5D_IS_BW true +#define GxEPD2_290_T94_IS_BW true +#define GxEPD2_290_M06_IS_BW true +#define GxEPD2_260_IS_BW true +#define GxEPD2_260_M01_IS_BW true +#define GxEPD2_270_IS_BW true +#define GxEPD2_371_IS_BW true +#define GxEPD2_420_IS_BW true +#define GxEPD2_420_M01_IS_BW true +#define GxEPD2_583_IS_BW true +#define GxEPD2_583_T8_IS_BW true +#define GxEPD2_750_IS_BW true +#define GxEPD2_750_T7_IS_BW true +// 3-color e-papers +#define GxEPD2_154c_IS_3C true +#define GxEPD2_154_Z90c_IS_3C true +#define GxEPD2_213c_IS_3C true +#define GxEPD2_213_Z19c_IS_3C true +#define GxEPD2_290c_IS_3C true +#define GxEPD2_290_Z13c_IS_3C true +#define GxEPD2_290_C90c_IS_3C true +#define GxEPD2_270c_IS_3C true +#define GxEPD2_420c_IS_3C true +#define GxEPD2_583c_IS_3C true +#define GxEPD2_750c_IS_3C true +#define GxEPD2_750c_Z08_IS_3C true +#define GxEPD2_750c_Z90_IS_3C true +#define GxEPD2_1248_IS_3C true +// 7-color e-paper +#define GxEPD2_565c_IS_7C true + +#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) +#define IS_GxEPD2_DRIVER(c, x) (c##x) +#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) +#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_BW used with 3-color driver class" +#endif +#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_3C used with b/w driver class" +#endif + +#endif diff --git a/examples/GxEPD2_SerialFlash_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_SerialFlash_Example/GxEPD2_display_selection_new_style.h index ad9a171..527cfc2 100644 --- a/examples/GxEPD2_SerialFlash_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_SerialFlash_Example/GxEPD2_display_selection_new_style.h @@ -27,10 +27,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -47,7 +49,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 @@ -80,6 +84,8 @@ #define IS_GxEPD2_7C(x) IS_GxEPD(GxEPD2_7C_IS_, x) #define IS_GxEPD2_1248(x) IS_GxEPD(GxEPD2_1248_IS_, x) +#include "GxEPD2_selection_check.h" + #if defined (ESP8266) #define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) diff --git a/examples/GxEPD2_SerialFlash_Example/GxEPD2_selection_check.h b/examples/GxEPD2_SerialFlash_Example/GxEPD2_selection_check.h new file mode 100644 index 0000000..d2b8d33 --- /dev/null +++ b/examples/GxEPD2_SerialFlash_Example/GxEPD2_selection_check.h @@ -0,0 +1,71 @@ +// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! +// +// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +// Supporting Arduino Forum Topics: +// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 +// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 + +#define GxEPD2_154_IS_BW true +#define GxEPD2_154_D67_IS_BW true +#define GxEPD2_154_T8_IS_BW true +#define GxEPD2_154_M09_IS_BW true +#define GxEPD2_154_M10_IS_BW true +#define GxEPD2_213_IS_BW true +#define GxEPD2_213_B72_IS_BW true +#define GxEPD2_213_B73_IS_BW true +#define GxEPD2_213_flex_IS_BW true +#define GxEPD2_213_M21_IS_BW true +#define GxEPD2_213_T5D_IS_BW true +#define GxEPD2_290_IS_BW true +#define GxEPD2_290_T5_IS_BW true +#define GxEPD2_290_T5D_IS_BW true +#define GxEPD2_290_T94_IS_BW true +#define GxEPD2_290_M06_IS_BW true +#define GxEPD2_260_IS_BW true +#define GxEPD2_260_M01_IS_BW true +#define GxEPD2_270_IS_BW true +#define GxEPD2_371_IS_BW true +#define GxEPD2_420_IS_BW true +#define GxEPD2_420_M01_IS_BW true +#define GxEPD2_583_IS_BW true +#define GxEPD2_583_T8_IS_BW true +#define GxEPD2_750_IS_BW true +#define GxEPD2_750_T7_IS_BW true +// 3-color e-papers +#define GxEPD2_154c_IS_3C true +#define GxEPD2_154_Z90c_IS_3C true +#define GxEPD2_213c_IS_3C true +#define GxEPD2_213_Z19c_IS_3C true +#define GxEPD2_290c_IS_3C true +#define GxEPD2_290_Z13c_IS_3C true +#define GxEPD2_290_C90c_IS_3C true +#define GxEPD2_270c_IS_3C true +#define GxEPD2_420c_IS_3C true +#define GxEPD2_583c_IS_3C true +#define GxEPD2_750c_IS_3C true +#define GxEPD2_750c_Z08_IS_3C true +#define GxEPD2_750c_Z90_IS_3C true +#define GxEPD2_1248_IS_3C true +// 7-color e-paper +#define GxEPD2_565c_IS_7C true + +#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) +#define IS_GxEPD2_DRIVER(c, x) (c##x) +#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) +#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_BW used with 3-color driver class" +#endif +#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_3C used with b/w driver class" +#endif + +#endif diff --git a/examples/GxEPD2_Spiffs_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_Spiffs_Example/GxEPD2_display_selection_new_style.h index ad9a171..527cfc2 100644 --- a/examples/GxEPD2_Spiffs_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_Spiffs_Example/GxEPD2_display_selection_new_style.h @@ -27,10 +27,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -47,7 +49,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 @@ -80,6 +84,8 @@ #define IS_GxEPD2_7C(x) IS_GxEPD(GxEPD2_7C_IS_, x) #define IS_GxEPD2_1248(x) IS_GxEPD(GxEPD2_1248_IS_, x) +#include "GxEPD2_selection_check.h" + #if defined (ESP8266) #define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) diff --git a/examples/GxEPD2_Spiffs_Example/GxEPD2_selection_check.h b/examples/GxEPD2_Spiffs_Example/GxEPD2_selection_check.h new file mode 100644 index 0000000..d2b8d33 --- /dev/null +++ b/examples/GxEPD2_Spiffs_Example/GxEPD2_selection_check.h @@ -0,0 +1,71 @@ +// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! +// +// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +// Supporting Arduino Forum Topics: +// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 +// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 + +#define GxEPD2_154_IS_BW true +#define GxEPD2_154_D67_IS_BW true +#define GxEPD2_154_T8_IS_BW true +#define GxEPD2_154_M09_IS_BW true +#define GxEPD2_154_M10_IS_BW true +#define GxEPD2_213_IS_BW true +#define GxEPD2_213_B72_IS_BW true +#define GxEPD2_213_B73_IS_BW true +#define GxEPD2_213_flex_IS_BW true +#define GxEPD2_213_M21_IS_BW true +#define GxEPD2_213_T5D_IS_BW true +#define GxEPD2_290_IS_BW true +#define GxEPD2_290_T5_IS_BW true +#define GxEPD2_290_T5D_IS_BW true +#define GxEPD2_290_T94_IS_BW true +#define GxEPD2_290_M06_IS_BW true +#define GxEPD2_260_IS_BW true +#define GxEPD2_260_M01_IS_BW true +#define GxEPD2_270_IS_BW true +#define GxEPD2_371_IS_BW true +#define GxEPD2_420_IS_BW true +#define GxEPD2_420_M01_IS_BW true +#define GxEPD2_583_IS_BW true +#define GxEPD2_583_T8_IS_BW true +#define GxEPD2_750_IS_BW true +#define GxEPD2_750_T7_IS_BW true +// 3-color e-papers +#define GxEPD2_154c_IS_3C true +#define GxEPD2_154_Z90c_IS_3C true +#define GxEPD2_213c_IS_3C true +#define GxEPD2_213_Z19c_IS_3C true +#define GxEPD2_290c_IS_3C true +#define GxEPD2_290_Z13c_IS_3C true +#define GxEPD2_290_C90c_IS_3C true +#define GxEPD2_270c_IS_3C true +#define GxEPD2_420c_IS_3C true +#define GxEPD2_583c_IS_3C true +#define GxEPD2_750c_IS_3C true +#define GxEPD2_750c_Z08_IS_3C true +#define GxEPD2_750c_Z90_IS_3C true +#define GxEPD2_1248_IS_3C true +// 7-color e-paper +#define GxEPD2_565c_IS_7C true + +#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) +#define IS_GxEPD2_DRIVER(c, x) (c##x) +#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) +#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_BW used with 3-color driver class" +#endif +#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_3C used with b/w driver class" +#endif + +#endif diff --git a/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_display_selection_new_style.h b/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_display_selection_new_style.h index ad9a171..527cfc2 100644 --- a/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_display_selection_new_style.h +++ b/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_display_selection_new_style.h @@ -27,10 +27,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -47,7 +49,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 @@ -80,6 +84,8 @@ #define IS_GxEPD2_7C(x) IS_GxEPD(GxEPD2_7C_IS_, x) #define IS_GxEPD2_1248(x) IS_GxEPD(GxEPD2_1248_IS_, x) +#include "GxEPD2_selection_check.h" + #if defined (ESP8266) #define MAX_DISPLAY_BUFFER_SIZE (81920ul-34000ul-5000ul) // ~34000 base use, change 5000 to your application use #if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) diff --git a/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_selection_check.h b/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_selection_check.h new file mode 100644 index 0000000..d2b8d33 --- /dev/null +++ b/examples/GxEPD2_U8G2_Fonts_Example/GxEPD2_selection_check.h @@ -0,0 +1,71 @@ +// Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines! +// +// Display Library based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +// Supporting Arduino Forum Topics: +// Waveshare e-paper displays with SPI: http://forum.arduino.cc/index.php?topic=487007.0 +// Good Display ePaper for Arduino: https://forum.arduino.cc/index.php?topic=436411.0 + +#define GxEPD2_154_IS_BW true +#define GxEPD2_154_D67_IS_BW true +#define GxEPD2_154_T8_IS_BW true +#define GxEPD2_154_M09_IS_BW true +#define GxEPD2_154_M10_IS_BW true +#define GxEPD2_213_IS_BW true +#define GxEPD2_213_B72_IS_BW true +#define GxEPD2_213_B73_IS_BW true +#define GxEPD2_213_flex_IS_BW true +#define GxEPD2_213_M21_IS_BW true +#define GxEPD2_213_T5D_IS_BW true +#define GxEPD2_290_IS_BW true +#define GxEPD2_290_T5_IS_BW true +#define GxEPD2_290_T5D_IS_BW true +#define GxEPD2_290_T94_IS_BW true +#define GxEPD2_290_M06_IS_BW true +#define GxEPD2_260_IS_BW true +#define GxEPD2_260_M01_IS_BW true +#define GxEPD2_270_IS_BW true +#define GxEPD2_371_IS_BW true +#define GxEPD2_420_IS_BW true +#define GxEPD2_420_M01_IS_BW true +#define GxEPD2_583_IS_BW true +#define GxEPD2_583_T8_IS_BW true +#define GxEPD2_750_IS_BW true +#define GxEPD2_750_T7_IS_BW true +// 3-color e-papers +#define GxEPD2_154c_IS_3C true +#define GxEPD2_154_Z90c_IS_3C true +#define GxEPD2_213c_IS_3C true +#define GxEPD2_213_Z19c_IS_3C true +#define GxEPD2_290c_IS_3C true +#define GxEPD2_290_Z13c_IS_3C true +#define GxEPD2_290_C90c_IS_3C true +#define GxEPD2_270c_IS_3C true +#define GxEPD2_420c_IS_3C true +#define GxEPD2_583c_IS_3C true +#define GxEPD2_750c_IS_3C true +#define GxEPD2_750c_Z08_IS_3C true +#define GxEPD2_750c_Z90_IS_3C true +#define GxEPD2_1248_IS_3C true +// 7-color e-paper +#define GxEPD2_565c_IS_7C true + +#if defined(GxEPD2_DISPLAY_CLASS) && defined(GxEPD2_DRIVER_CLASS) +#define IS_GxEPD2_DRIVER(c, x) (c##x) +#define IS_GxEPD2_DRIVER_BW(x) IS_GxEPD2_DRIVER(x, _IS_BW) +#define IS_GxEPD2_DRIVER_3C(x) IS_GxEPD2_DRIVER(x, _IS_3C) +#if IS_GxEPD2_BW(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_3C(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_BW used with 3-color driver class" +#endif +#if IS_GxEPD2_3C(GxEPD2_DISPLAY_CLASS) && IS_GxEPD2_DRIVER_BW(GxEPD2_DRIVER_CLASS) +#error "GxEPD2_3C used with b/w driver class" +#endif + +#endif diff --git a/examples/GxEPD2_WS_ESP32_Driver/GxEPD2_WS_ESP32_Driver.ino b/examples/GxEPD2_WS_ESP32_Driver/GxEPD2_WS_ESP32_Driver.ino index bac1bd2..4e4a021 100644 --- a/examples/GxEPD2_WS_ESP32_Driver/GxEPD2_WS_ESP32_Driver.ino +++ b/examples/GxEPD2_WS_ESP32_Driver/GxEPD2_WS_ESP32_Driver.ino @@ -49,10 +49,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -69,7 +71,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 diff --git a/examples/GxEPD2_WiFi_Example/GxEPD2_WiFi_Example.ino b/examples/GxEPD2_WiFi_Example/GxEPD2_WiFi_Example.ino index f3471fe..822fc12 100644 --- a/examples/GxEPD2_WiFi_Example/GxEPD2_WiFi_Example.ino +++ b/examples/GxEPD2_WiFi_Example/GxEPD2_WiFi_Example.ino @@ -46,10 +46,12 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_213 // GDE0213B1 128x250, phased out //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B72 // GDEH0213B72 128x250 //#define GxEPD2_DRIVER_CLASS GxEPD2_213_B73 // GDEH0213B73 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 128x250 -//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 128x250 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_flex // GDEW0213I5F 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_M21 // GDEW0213M21 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_T5D // GDEW0213T5D 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290 // GDEH029A1 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5 // GDEW029T5 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_T5D // GDEW029T5D 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_T94 // GDEM029T94 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_M06 // GDEW029M06 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_260 // GDEW026T0 152x296 @@ -66,7 +68,9 @@ //#define GxEPD2_DRIVER_CLASS GxEPD2_154c // GDEW0154Z04 200x200, no longer available //#define GxEPD2_DRIVER_CLASS GxEPD2_154_Z90c // GDEH0154Z90 200x200 //#define GxEPD2_DRIVER_CLASS GxEPD2_213c // GDEW0213Z16 104x212 +//#define GxEPD2_DRIVER_CLASS GxEPD2_213_Z19c // GDEW0213Z19 104x212 //#define GxEPD2_DRIVER_CLASS GxEPD2_290c // GDEW029Z10 128x296 +//#define GxEPD2_DRIVER_CLASS GxEPD2_290_Z13c // GDEH029Z13 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_290_C90c // GDEM029C90 128x296 //#define GxEPD2_DRIVER_CLASS GxEPD2_270c // GDEW027C44 176x264 //#define GxEPD2_DRIVER_CLASS GxEPD2_420c // GDEW042Z15 400x300 diff --git a/library.properties b/library.properties index 2c7638e..58c0e0a 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=GxEPD2 -version=1.3.1 +version=1.3.2 author=Jean-Marc Zingg maintainer=Jean-Marc Zingg sentence=Arduino Display Library for SPI E-Paper displays from Dalian Good Display and Waveshare. diff --git a/src/GxEPD2.h b/src/GxEPD2.h index 427c414..69e363e 100644 --- a/src/GxEPD2.h +++ b/src/GxEPD2.h @@ -45,10 +45,12 @@ class GxEPD2 GDEH0213B73, Waveshare_2_13_bw_B73 = GDEH0213B73, GDEW0213I5F, Waveshare_2_13_flex = GDEW0213I5F, GDEW0213M21, + GDEW0213T5D, GDEW026T0, Waveshare_2_6_bw = GDEW026T0, GDEW026M01, GDEH029A1, Waveshare_2_9_bw = GDEH029A1, GDEW029T5, Waveshare_2_9_bw_T5 = GDEW029T5, + GDEW029T5D, GDEW029M06, GDEM029T94, GDEW027W3, Waveshare_2_7_bw = GDEW027W3, @@ -66,7 +68,9 @@ class GxEPD2 GDEW0154Z04, Waveshare_1_54_bwr = GDEW0154Z04, GDEH0154Z90, Waveshare_1_54_bwr_Z90 = GDEH0154Z90, GDEW0213Z16, Waveshare_2_13_bwr = GDEW0213Z16, + GDEW0213Z19, GDEW029Z10, Waveshare_2_9_bwr = GDEW029Z10, + GDEH029Z13, GDEM029C90, GDEW027C44, Waveshare_2_7_bwr = GDEW027C44, GDEW042Z15, Waveshare_4_2_bwr = GDEW042Z15, diff --git a/src/GxEPD2_3C.h b/src/GxEPD2_3C.h index d29d9b7..9f96d75 100644 --- a/src/GxEPD2_3C.h +++ b/src/GxEPD2_3C.h @@ -33,7 +33,9 @@ #include "epd3c/GxEPD2_154c.h" #include "epd3c/GxEPD2_154_Z90c.h" #include "epd3c/GxEPD2_213c.h" +#include "epd3c/GxEPD2_213_Z19c.h" #include "epd3c/GxEPD2_290c.h" +#include "epd3c/GxEPD2_290_Z13c.h" #include "epd3c/GxEPD2_290_C90c.h" #include "epd3c/GxEPD2_270c.h" #include "epd3c/GxEPD2_420c.h" @@ -126,7 +128,7 @@ class GxEPD2_3C : public GxEPD2_GFX_BASE_CLASS // init method with additional parameters: // initial false for re-init after processor deep sleep wake up, if display power supply was kept // only relevant for b/w displays with fast partial update - // reset_duration = 20 is default; a value of 2 may help with "clever" reset circuit of newer boards from Waveshare + // reset_duration = 20 is default; a value of 2 may help with "clever" reset circuit of newer boards from Waveshare // pulldown_rst_mode true for alternate RST handling to avoid feeding 5V through RST pin void init(uint32_t serial_diag_bitrate, bool initial, uint16_t reset_duration = 20, bool pulldown_rst_mode = false) { @@ -398,7 +400,7 @@ class GxEPD2_3C : public GxEPD2_GFX_BASE_CLASS epd2.drawImage(bitmap, x, y, w, h, invert, mirror_y, pgm); } void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, - int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false) { epd2.drawImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); } @@ -411,12 +413,12 @@ class GxEPD2_3C : public GxEPD2_GFX_BASE_CLASS epd2.drawImage(black, color, x, y, w, h, false, false, false); } 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, - int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) { epd2.drawImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); } 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, - int16_t x, int16_t y, int16_t w, int16_t h) + int16_t x, int16_t y, int16_t w, int16_t h) { epd2.drawImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, false, false, false); } diff --git a/src/GxEPD2_BW.h b/src/GxEPD2_BW.h index a4c98aa..b727cc0 100644 --- a/src/GxEPD2_BW.h +++ b/src/GxEPD2_BW.h @@ -41,10 +41,12 @@ #include "epd/GxEPD2_213_B73.h" #include "epd/GxEPD2_213_flex.h" #include "epd/GxEPD2_213_M21.h" +#include "epd/GxEPD2_213_T5D.h" #include "epd/GxEPD2_260.h" #include "epd/GxEPD2_260_M01.h" #include "epd/GxEPD2_290.h" #include "epd/GxEPD2_290_T5.h" +#include "epd/GxEPD2_290_T5D.h" #include "epd/GxEPD2_290_M06.h" #include "epd/GxEPD2_290_T94.h" #include "epd/GxEPD2_270.h" diff --git a/src/epd/GxEPD2_213_T5D.cpp b/src/epd/GxEPD2_213_T5D.cpp new file mode 100644 index 0000000..4dec9be --- /dev/null +++ b/src/epd/GxEPD2_213_T5D.cpp @@ -0,0 +1,437 @@ +// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! +// +// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// Controller: UC8151D : https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +#include "GxEPD2_213_T5D.h" + +GxEPD2_213_T5D::GxEPD2_213_T5D(int8_t cs, int8_t dc, int8_t rst, int8_t busy) : + GxEPD2_EPD(cs, dc, rst, busy, LOW, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate) +{ +} + +void GxEPD2_213_T5D::clearScreen(uint8_t value) +{ + writeScreenBuffer(value); + refresh(true); + writeScreenBufferAgain(value); +} + +void GxEPD2_213_T5D::writeScreenBuffer(uint8_t value) +{ + if (!_using_partial_mode) _Init_Part(); + if (_initial_write) _writeScreenBuffer(0x10, value); // set previous + _writeScreenBuffer(0x13, value); // set current + _initial_write = false; // initial full screen buffer clean done +} + +void GxEPD2_213_T5D::writeScreenBufferAgain(uint8_t value) +{ + if (!_using_partial_mode) _Init_Part(); + _writeScreenBuffer(0x13, value); // set current +} + +void GxEPD2_213_T5D::_writeScreenBuffer(uint8_t command, uint8_t value) +{ + _writeCommand(command); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(value); + } +} + +void GxEPD2_213_T5D::writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + _writeImage(0x13, bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_213_T5D::writeImageForFullRefresh(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + _writeImage(0x10, bitmap, x, y, w, h, invert, mirror_y, pgm); + _writeImage(0x13, bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_213_T5D::writeImageAgain(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + _writeImage(0x13, bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_213_T5D::_writeImage(uint8_t command, const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 + int16_t wb = (w + 7) / 8; // width bytes, bitmaps are padded + x -= x % 8; // byte boundary + w = wb * 8; // byte boundary + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + int16_t dx = x1 - x; + int16_t dy = y1 - y; + w1 -= dx; + h1 -= dy; + if ((w1 <= 0) || (h1 <= 0)) return; + if (!_using_partial_mode) _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _writeCommand(command); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data; + // use wb, h of bitmap for index! + int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&bitmap[idx]); +#else + data = bitmap[idx]; +#endif + } + else + { + data = bitmap[idx]; + } + if (invert) data = ~data; + _writeData(data); + } + } + _writeCommand(0x92); // partial out + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 +} + +void GxEPD2_213_T5D::writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + _writeImagePart(0x13, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_213_T5D::writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + _writeImagePart(0x13, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_213_T5D::_writeImagePart(uint8_t command, const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 + if ((w_bitmap < 0) || (h_bitmap < 0) || (w < 0) || (h < 0)) return; + if ((x_part < 0) || (x_part >= w_bitmap)) return; + if ((y_part < 0) || (y_part >= h_bitmap)) return; + int16_t wb_bitmap = (w_bitmap + 7) / 8; // width bytes, bitmaps are padded + x_part -= x_part % 8; // byte boundary + w = w_bitmap - x_part < w ? w_bitmap - x_part : w; // limit + h = h_bitmap - y_part < h ? h_bitmap - y_part : h; // limit + x -= x % 8; // byte boundary + w = 8 * ((w + 7) / 8); // byte boundary, bitmaps are padded + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + int16_t dx = x1 - x; + int16_t dy = y1 - y; + w1 -= dx; + h1 -= dy; + if ((w1 <= 0) || (h1 <= 0)) return; + if (!_using_partial_mode) _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _writeCommand(command); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data; + // use wb_bitmap, h_bitmap of bitmap for index! + int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&bitmap[idx]); +#else + data = bitmap[idx]; +#endif + } + else + { + data = bitmap[idx]; + } + if (invert) data = ~data; + _writeData(data); + } + } + _writeCommand(0x92); // partial out + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 +} + +void GxEPD2_213_T5D::writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (black) + { + writeImage(black, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_213_T5D::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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (black) + { + writeImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_213_T5D::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (data1) + { + writeImage(data1, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_213_T5D::drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); + writeImageAgain(bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_213_T5D::drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); + writeImagePartAgain(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_213_T5D::drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (black) + { + drawImage(black, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_213_T5D::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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (black) + { + drawImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_213_T5D::drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (data1) + { + drawImage(data1, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_213_T5D::refresh(bool partial_update_mode) +{ + if (partial_update_mode) refresh(0, 0, WIDTH, HEIGHT); + else + { + if (_using_partial_mode) _Init_Full(); + _Update_Full(); + _initial_refresh = false; // initial full update done + } +} + +void GxEPD2_213_T5D::refresh(int16_t x, int16_t y, int16_t w, int16_t h) +{ + if (_initial_refresh) return refresh(false); // initial update needs be full update + x -= x % 8; // byte boundary + w -= x % 8; // byte boundary + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + w1 -= x1 - x; + h1 -= y1 - y; + if (!_using_partial_mode) _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _Update_Part(); + _writeCommand(0x92); // partial out +} + +void GxEPD2_213_T5D::powerOff(void) +{ + _PowerOff(); +} + +void GxEPD2_213_T5D::hibernate() +{ + _PowerOff(); + if (_rst >= 0) + { + _writeCommand(0x07); // deep sleep + _writeData(0xA5); // check code + _hibernating = true; + } +} + +void GxEPD2_213_T5D::_setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h) +{ + uint16_t xe = (x + w - 1) | 0x0007; // byte boundary inclusive (last byte) + uint16_t ye = y + h - 1; + x &= 0xFFF8; // byte boundary + _writeCommand(0x90); // partial window + //_writeData(x / 256); + _writeData(x % 256); + //_writeData(xe / 256); + _writeData(xe % 256); + _writeData(y / 256); + _writeData(y % 256); + _writeData(ye / 256); + _writeData(ye % 256); + _writeData(0x01); // don't see any difference + //_writeData(0x00); // don't see any difference +} + +void GxEPD2_213_T5D::_PowerOn() +{ + if (!_power_is_on) + { + _writeCommand(0x04); + _waitWhileBusy("_PowerOn", power_on_time); + } + _power_is_on = true; +} + +void GxEPD2_213_T5D::_PowerOff() +{ + _writeCommand(0x02); // power off + _waitWhileBusy("_PowerOff", power_off_time); + _power_is_on = false; + _using_partial_mode = false; +} + +void GxEPD2_213_T5D::_InitDisplay() +{ + if (_hibernating) _reset(); + _writeCommand(0x00); // panel setting + _writeData(0x1f); // LUT from OTP, 128x296 + _writeCommand(0x61); //resolution setting + _writeData (WIDTH); + _writeData (HEIGHT >> 8); + _writeData (HEIGHT & 0xFF); + _writeCommand(0x50); // VCOM AND DATA INTERVAL SETTING + _writeData(0x97); // WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 +} + +//partial screen update LUT +//#define Tx19 0x19 // original value is 25 (phase length) +#define Tx19 0x20 // new value for test is 32 (phase length) +const unsigned char GxEPD2_213_T5D::lut_20_vcomDC_partial[] PROGMEM = +{ + 0x00, Tx19, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, +}; + +const unsigned char GxEPD2_213_T5D::lut_21_ww_partial[] PROGMEM = +{ + 0x00, Tx19, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char GxEPD2_213_T5D::lut_22_bw_partial[] PROGMEM = +{ + 0x80, Tx19, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char GxEPD2_213_T5D::lut_23_wb_partial[] PROGMEM = +{ + 0x40, Tx19, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char GxEPD2_213_T5D::lut_24_bb_partial[] PROGMEM = +{ + 0x00, Tx19, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +void GxEPD2_213_T5D::_Init_Full() +{ + _InitDisplay(); + _PowerOn(); + _using_partial_mode = false; +} + +void GxEPD2_213_T5D::_Init_Part() +{ + _InitDisplay(); + _writeCommand(0x00); //panel setting + _writeData(hasFastPartialUpdate ? 0xbf : 0x1f); // for test with OTP LUT + _writeCommand(0x82); //vcom_DC setting + _writeData (0x08); + _writeCommand(0x50); + _writeData(0x17); //WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 + _writeCommand(0x20); + _writeDataPGM(lut_20_vcomDC_partial, sizeof(lut_20_vcomDC_partial)); + _writeCommand(0x21); + _writeDataPGM(lut_21_ww_partial, sizeof(lut_21_ww_partial)); + _writeCommand(0x22); + _writeDataPGM(lut_22_bw_partial, sizeof(lut_22_bw_partial)); + _writeCommand(0x23); + _writeDataPGM(lut_23_wb_partial, sizeof(lut_23_wb_partial)); + _writeCommand(0x24); + _writeDataPGM(lut_24_bb_partial, sizeof(lut_24_bb_partial)); + _PowerOn(); + _using_partial_mode = true; +} + +void GxEPD2_213_T5D::_Update_Full() +{ + _writeCommand(0x12); //display refresh + _waitWhileBusy("_Update_Full", full_refresh_time); +} + +void GxEPD2_213_T5D::_Update_Part() +{ + _writeCommand(0x12); //display refresh + _waitWhileBusy("_Update_Part", partial_refresh_time); +} diff --git a/src/epd/GxEPD2_213_T5D.h b/src/epd/GxEPD2_213_T5D.h new file mode 100644 index 0000000..12ff49c --- /dev/null +++ b/src/epd/GxEPD2_213_T5D.h @@ -0,0 +1,87 @@ +// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! +// +// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// Controller: UC8151D : https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +#ifndef _GxEPD2_213_T5D_H_ +#define _GxEPD2_213_T5D_H_ + +#include "../GxEPD2_EPD.h" + +class GxEPD2_213_T5D : public GxEPD2_EPD +{ + public: + // attributes + static const uint16_t WIDTH = 104; + static const uint16_t HEIGHT = 212; + static const GxEPD2::Panel panel = GxEPD2::GDEW0213T5D; + static const bool hasColor = false; + static const bool hasPartialUpdate = true; + static const bool hasFastPartialUpdate = true; + static const uint16_t power_on_time = 100; // ms, e.g. 83358us + static const uint16_t power_off_time = 50; // ms, e.g. 39131us + static const uint16_t full_refresh_time = 4700; // ms, e.g. 4615853us + static const uint16_t partial_refresh_time = 750; // ms, e.g. 699013us + // constructor + GxEPD2_213_T5D(int8_t cs, int8_t dc, int8_t rst, int8_t busy); + // methods (virtual) + // Support for Bitmaps (Sprites) to Controller Buffer and to Screen + void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) + void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) + void writeScreenBufferAgain(uint8_t value = 0xFF); // init previous buffer controller memory (default white) + // write to controller memory, without screen refresh; x and w should be multiple of 8 + 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); + void writeImageForFullRefresh(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); + void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + 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); + 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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // for differential update: set current and previous buffers equal (for fast partial update to work correctly) + void writeImageAgain(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); + void writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 + void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write to controller memory, with screen refresh; x and w should be multiple of 8 + 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); + void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + 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); + 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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 + void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen + void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen + void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time + void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) + private: + void _writeScreenBuffer(uint8_t command, uint8_t value); + void _writeImage(uint8_t command, 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); + void _writeImagePart(uint8_t command, const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); + void _PowerOn(); + void _PowerOff(); + void _InitDisplay(); + void _Init_Full(); + void _Init_Part(); + void _Update_Full(); + void _Update_Part(); + private: + static const unsigned char lut_20_vcomDC_partial[]; + static const unsigned char lut_21_ww_partial[]; + static const unsigned char lut_22_bw_partial[]; + static const unsigned char lut_23_wb_partial[]; + static const unsigned char lut_24_bb_partial[]; +}; + +#endif diff --git a/src/epd/GxEPD2_290_T5D.cpp b/src/epd/GxEPD2_290_T5D.cpp new file mode 100644 index 0000000..ac5256f --- /dev/null +++ b/src/epd/GxEPD2_290_T5D.cpp @@ -0,0 +1,437 @@ +// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! +// +// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// Controller: UC8151D : https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +#include "GxEPD2_290_T5D.h" + +GxEPD2_290_T5D::GxEPD2_290_T5D(int8_t cs, int8_t dc, int8_t rst, int8_t busy) : + GxEPD2_EPD(cs, dc, rst, busy, LOW, 10000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate) +{ +} + +void GxEPD2_290_T5D::clearScreen(uint8_t value) +{ + writeScreenBuffer(value); + refresh(true); + writeScreenBufferAgain(value); +} + +void GxEPD2_290_T5D::writeScreenBuffer(uint8_t value) +{ + if (!_using_partial_mode) _Init_Part(); + if (_initial_write) _writeScreenBuffer(0x10, value); // set previous + _writeScreenBuffer(0x13, value); // set current + _initial_write = false; // initial full screen buffer clean done +} + +void GxEPD2_290_T5D::writeScreenBufferAgain(uint8_t value) +{ + if (!_using_partial_mode) _Init_Part(); + _writeScreenBuffer(0x13, value); // set current +} + +void GxEPD2_290_T5D::_writeScreenBuffer(uint8_t command, uint8_t value) +{ + _writeCommand(command); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(value); + } +} + +void GxEPD2_290_T5D::writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + _writeImage(0x13, bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_T5D::writeImageForFullRefresh(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + _writeImage(0x10, bitmap, x, y, w, h, invert, mirror_y, pgm); + _writeImage(0x13, bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_T5D::writeImageAgain(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + _writeImage(0x13, bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_T5D::_writeImage(uint8_t command, const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 + int16_t wb = (w + 7) / 8; // width bytes, bitmaps are padded + x -= x % 8; // byte boundary + w = wb * 8; // byte boundary + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + int16_t dx = x1 - x; + int16_t dy = y1 - y; + w1 -= dx; + h1 -= dy; + if ((w1 <= 0) || (h1 <= 0)) return; + if (!_using_partial_mode) _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _writeCommand(command); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data; + // use wb, h of bitmap for index! + int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&bitmap[idx]); +#else + data = bitmap[idx]; +#endif + } + else + { + data = bitmap[idx]; + } + if (invert) data = ~data; + _writeData(data); + } + } + _writeCommand(0x92); // partial out + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 +} + +void GxEPD2_290_T5D::writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + _writeImagePart(0x13, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_T5D::writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + _writeImagePart(0x13, bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_T5D::_writeImagePart(uint8_t command, const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 + if ((w_bitmap < 0) || (h_bitmap < 0) || (w < 0) || (h < 0)) return; + if ((x_part < 0) || (x_part >= w_bitmap)) return; + if ((y_part < 0) || (y_part >= h_bitmap)) return; + int16_t wb_bitmap = (w_bitmap + 7) / 8; // width bytes, bitmaps are padded + x_part -= x_part % 8; // byte boundary + w = w_bitmap - x_part < w ? w_bitmap - x_part : w; // limit + h = h_bitmap - y_part < h ? h_bitmap - y_part : h; // limit + x -= x % 8; // byte boundary + w = 8 * ((w + 7) / 8); // byte boundary, bitmaps are padded + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + int16_t dx = x1 - x; + int16_t dy = y1 - y; + w1 -= dx; + h1 -= dy; + if ((w1 <= 0) || (h1 <= 0)) return; + if (!_using_partial_mode) _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _writeCommand(command); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data; + // use wb_bitmap, h_bitmap of bitmap for index! + int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&bitmap[idx]); +#else + data = bitmap[idx]; +#endif + } + else + { + data = bitmap[idx]; + } + if (invert) data = ~data; + _writeData(data); + } + } + _writeCommand(0x92); // partial out + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 +} + +void GxEPD2_290_T5D::writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (black) + { + writeImage(black, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_290_T5D::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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (black) + { + writeImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_290_T5D::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (data1) + { + writeImage(data1, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_290_T5D::drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); + writeImageAgain(bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_T5D::drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); + writeImagePartAgain(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_T5D::drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (black) + { + drawImage(black, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_290_T5D::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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (black) + { + drawImagePart(black, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_290_T5D::drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (data1) + { + drawImage(data1, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_290_T5D::refresh(bool partial_update_mode) +{ + if (partial_update_mode) refresh(0, 0, WIDTH, HEIGHT); + else + { + if (_using_partial_mode) _Init_Full(); + _Update_Full(); + _initial_refresh = false; // initial full update done + } +} + +void GxEPD2_290_T5D::refresh(int16_t x, int16_t y, int16_t w, int16_t h) +{ + if (_initial_refresh) return refresh(false); // initial update needs be full update + x -= x % 8; // byte boundary + w -= x % 8; // byte boundary + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + w1 -= x1 - x; + h1 -= y1 - y; + if (!_using_partial_mode) _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _Update_Part(); + _writeCommand(0x92); // partial out +} + +void GxEPD2_290_T5D::powerOff(void) +{ + _PowerOff(); +} + +void GxEPD2_290_T5D::hibernate() +{ + _PowerOff(); + if (_rst >= 0) + { + _writeCommand(0x07); // deep sleep + _writeData(0xA5); // check code + _hibernating = true; + } +} + +void GxEPD2_290_T5D::_setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h) +{ + uint16_t xe = (x + w - 1) | 0x0007; // byte boundary inclusive (last byte) + uint16_t ye = y + h - 1; + x &= 0xFFF8; // byte boundary + _writeCommand(0x90); // partial window + //_writeData(x / 256); + _writeData(x % 256); + //_writeData(xe / 256); + _writeData(xe % 256); + _writeData(y / 256); + _writeData(y % 256); + _writeData(ye / 256); + _writeData(ye % 256); + _writeData(0x01); // don't see any difference + //_writeData(0x00); // don't see any difference +} + +void GxEPD2_290_T5D::_PowerOn() +{ + if (!_power_is_on) + { + _writeCommand(0x04); + _waitWhileBusy("_PowerOn", power_on_time); + } + _power_is_on = true; +} + +void GxEPD2_290_T5D::_PowerOff() +{ + _writeCommand(0x02); // power off + _waitWhileBusy("_PowerOff", power_off_time); + _power_is_on = false; + _using_partial_mode = false; +} + +void GxEPD2_290_T5D::_InitDisplay() +{ + if (_hibernating) _reset(); + _writeCommand(0x00); // panel setting + _writeData(0x1f); // LUT from OTP, 128x296 + _writeCommand(0x61); //resolution setting + _writeData (WIDTH); + _writeData (HEIGHT >> 8); + _writeData (HEIGHT & 0xFF); + _writeCommand(0x50); // VCOM AND DATA INTERVAL SETTING + _writeData(0x97); // WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 +} + +//partial screen update LUT +//#define Tx19 0x19 // original value is 25 (phase length) +#define Tx19 0x20 // new value for test is 32 (phase length) +const unsigned char GxEPD2_290_T5D::lut_20_vcomDC_partial[] PROGMEM = +{ + 0x00, Tx19, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, +}; + +const unsigned char GxEPD2_290_T5D::lut_21_ww_partial[] PROGMEM = +{ + 0x00, Tx19, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char GxEPD2_290_T5D::lut_22_bw_partial[] PROGMEM = +{ + 0x80, Tx19, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char GxEPD2_290_T5D::lut_23_wb_partial[] PROGMEM = +{ + 0x40, Tx19, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +const unsigned char GxEPD2_290_T5D::lut_24_bb_partial[] PROGMEM = +{ + 0x00, Tx19, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; + +void GxEPD2_290_T5D::_Init_Full() +{ + _InitDisplay(); + _PowerOn(); + _using_partial_mode = false; +} + +void GxEPD2_290_T5D::_Init_Part() +{ + _InitDisplay(); + _writeCommand(0x00); //panel setting + _writeData(hasFastPartialUpdate ? 0xbf : 0x1f); // for test with OTP LUT + _writeCommand(0x82); //vcom_DC setting + _writeData (0x08); + _writeCommand(0x50); + _writeData(0x17); //WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 + _writeCommand(0x20); + _writeDataPGM(lut_20_vcomDC_partial, sizeof(lut_20_vcomDC_partial)); + _writeCommand(0x21); + _writeDataPGM(lut_21_ww_partial, sizeof(lut_21_ww_partial)); + _writeCommand(0x22); + _writeDataPGM(lut_22_bw_partial, sizeof(lut_22_bw_partial)); + _writeCommand(0x23); + _writeDataPGM(lut_23_wb_partial, sizeof(lut_23_wb_partial)); + _writeCommand(0x24); + _writeDataPGM(lut_24_bb_partial, sizeof(lut_24_bb_partial)); + _PowerOn(); + _using_partial_mode = true; +} + +void GxEPD2_290_T5D::_Update_Full() +{ + _writeCommand(0x12); //display refresh + _waitWhileBusy("_Update_Full", full_refresh_time); +} + +void GxEPD2_290_T5D::_Update_Part() +{ + _writeCommand(0x12); //display refresh + _waitWhileBusy("_Update_Part", partial_refresh_time); +} diff --git a/src/epd/GxEPD2_290_T5D.h b/src/epd/GxEPD2_290_T5D.h new file mode 100644 index 0000000..7c43b69 --- /dev/null +++ b/src/epd/GxEPD2_290_T5D.h @@ -0,0 +1,87 @@ +// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! +// +// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// Controller: UC8151D : https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +#ifndef _GxEPD2_290_T5D_H_ +#define _GxEPD2_290_T5D_H_ + +#include "../GxEPD2_EPD.h" + +class GxEPD2_290_T5D : public GxEPD2_EPD +{ + public: + // attributes + static const uint16_t WIDTH = 128; + static const uint16_t HEIGHT = 296; + static const GxEPD2::Panel panel = GxEPD2::GDEW029T5D; + static const bool hasColor = false; + static const bool hasPartialUpdate = true; + static const bool hasFastPartialUpdate = true; + static const uint16_t power_on_time = 100; // ms, e.g. 96606us + static const uint16_t power_off_time = 50; // ms, e.g. 39711us + static const uint16_t full_refresh_time = 3500; // ms, e.g. 3251067us + static const uint16_t partial_refresh_time = 750; // ms, e.g. 704907us + // constructor + GxEPD2_290_T5D(int8_t cs, int8_t dc, int8_t rst, int8_t busy); + // methods (virtual) + // Support for Bitmaps (Sprites) to Controller Buffer and to Screen + void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) + void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) + void writeScreenBufferAgain(uint8_t value = 0xFF); // init previous buffer controller memory (default white) + // write to controller memory, without screen refresh; x and w should be multiple of 8 + 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); + void writeImageForFullRefresh(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); + void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + 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); + 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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // for differential update: set current and previous buffers equal (for fast partial update to work correctly) + void writeImageAgain(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); + void writeImagePartAgain(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 + void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write to controller memory, with screen refresh; x and w should be multiple of 8 + 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); + void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + 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); + 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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 + void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen + void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen + void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time + void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) + private: + void _writeScreenBuffer(uint8_t command, uint8_t value); + void _writeImage(uint8_t command, 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); + void _writeImagePart(uint8_t command, const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); + void _PowerOn(); + void _PowerOff(); + void _InitDisplay(); + void _Init_Full(); + void _Init_Part(); + void _Update_Full(); + void _Update_Part(); + private: + static const unsigned char lut_20_vcomDC_partial[]; + static const unsigned char lut_21_ww_partial[]; + static const unsigned char lut_22_bw_partial[]; + static const unsigned char lut_23_wb_partial[]; + static const unsigned char lut_24_bb_partial[]; +}; + +#endif diff --git a/src/epd3c/GxEPD2_213_Z19c.cpp b/src/epd3c/GxEPD2_213_Z19c.cpp new file mode 100644 index 0000000..6d98319 --- /dev/null +++ b/src/epd3c/GxEPD2_213_Z19c.cpp @@ -0,0 +1,387 @@ +// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! +// +// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// Controller: UC8151D : https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +#include "GxEPD2_213_Z19c.h" + +GxEPD2_213_Z19c::GxEPD2_213_Z19c(int8_t cs, int8_t dc, int8_t rst, int8_t busy) : + GxEPD2_EPD(cs, dc, rst, busy, LOW, 20000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate) +{ +} + +void GxEPD2_213_Z19c::clearScreen(uint8_t value) +{ + clearScreen(value, 0xFF); +} + +void GxEPD2_213_Z19c::clearScreen(uint8_t black_value, uint8_t color_value) +{ + _initial_write = false; // initial full screen buffer clean done + _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(0, 0, WIDTH, HEIGHT); + _writeCommand(0x10); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(black_value); + } + _writeCommand(0x13); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(color_value); + } + _Update_Part(); + _writeCommand(0x92); // partial out +} + +void GxEPD2_213_Z19c::writeScreenBuffer(uint8_t value) +{ + writeScreenBuffer(value, 0xFF); +} + +void GxEPD2_213_Z19c::writeScreenBuffer(uint8_t black_value, uint8_t color_value) +{ + _initial_write = false; // initial full screen buffer clean done + _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(0, 0, WIDTH, HEIGHT); + _writeCommand(0x10); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(black_value); + } + _writeCommand(0x13); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(color_value); + } + _writeCommand(0x92); // partial out +} + +void GxEPD2_213_Z19c::writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(bitmap, NULL, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_213_Z19c::writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 + int16_t wb = (w + 7) / 8; // width bytes, bitmaps are padded + x -= x % 8; // byte boundary + w = wb * 8; // byte boundary + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + int16_t dx = x1 - x; + int16_t dy = y1 - y; + w1 -= dx; + h1 -= dy; + if ((w1 <= 0) || (h1 <= 0)) return; + _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _writeCommand(0x10); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data = 0xFF; + if (black) + { + // use wb, h of bitmap for index! + int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&black[idx]); +#else + data = black[idx]; +#endif + } + else + { + data = black[idx]; + } + if (invert) data = ~data; + } + _writeData(data); + } + } + _writeCommand(0x13); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data = 0xFF; + if (color) + { + // use wb, h of bitmap for index! + int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&color[idx]); +#else + data = color[idx]; +#endif + } + else + { + data = color[idx]; + } + if (invert) data = ~data; + } + _writeData(data); + } + } + _writeCommand(0x92); // partial out + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 +} + +void GxEPD2_213_Z19c::writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(bitmap, NULL, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_213_Z19c::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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 + if ((w_bitmap < 0) || (h_bitmap < 0) || (w < 0) || (h < 0)) return; + if ((x_part < 0) || (x_part >= w_bitmap)) return; + if ((y_part < 0) || (y_part >= h_bitmap)) return; + int16_t wb_bitmap = (w_bitmap + 7) / 8; // width bytes, bitmaps are padded + x_part -= x_part % 8; // byte boundary + w = w_bitmap - x_part < w ? w_bitmap - x_part : w; // limit + h = h_bitmap - y_part < h ? h_bitmap - y_part : h; // limit + x -= x % 8; // byte boundary + w = 8 * ((w + 7) / 8); // byte boundary, bitmaps are padded + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + int16_t dx = x1 - x; + int16_t dy = y1 - y; + w1 -= dx; + h1 -= dy; + if ((w1 <= 0) || (h1 <= 0)) return; + if (!_using_partial_mode) _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _writeCommand(0x10); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data; + // use wb_bitmap, h_bitmap of bitmap for index! + int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&black[idx]); +#else + data = black[idx]; +#endif + } + else + { + data = black[idx]; + } + if (invert) data = ~data; + _writeData(data); + } + } + _writeCommand(0x13); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data = 0xFF; + if (color) + { + // use wb_bitmap, h_bitmap of bitmap for index! + int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&color[idx]); +#else + data = color[idx]; +#endif + } + else + { + data = color[idx]; + } + if (invert) data = ~data; + } + _writeData(data); + } + } + _writeCommand(0x92); // partial out + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 +} + +void GxEPD2_213_Z19c::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (data1) + { + writeImage(data1, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_213_Z19c::drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_213_Z19c::drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_213_Z19c::drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(black, color, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_213_Z19c::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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_213_Z19c::drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_213_Z19c::refresh(bool partial_update_mode) +{ + if (partial_update_mode) refresh(0, 0, WIDTH, HEIGHT); + else _Update_Full(); +} + +void GxEPD2_213_Z19c::refresh(int16_t x, int16_t y, int16_t w, int16_t h) +{ + x -= x % 8; // byte boundary + w -= w % 8; // byte boundary + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + w1 -= x1 - x; + h1 -= y1 - y; + _Init_Part(); + if (usePartialUpdateWindow) _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _Update_Part(); + if (usePartialUpdateWindow) _writeCommand(0x92); // partial out +} + +void GxEPD2_213_Z19c::powerOff() +{ + _PowerOff(); +} + +void GxEPD2_213_Z19c::hibernate() +{ + _PowerOff(); + if (_rst >= 0) + { + _writeCommand(0x07); // deep sleep + _writeData(0xA5); // check code + _hibernating = true; + } +} + +void GxEPD2_213_Z19c::_setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h) +{ + uint16_t xe = (x + w - 1) | 0x0007; // byte boundary inclusive (last byte) + uint16_t ye = y + h - 1; + x &= 0xFFF8; // byte boundary + _writeCommand(0x90); // partial window + //_writeData(x / 256); + _writeData(x % 256); + //_writeData(xe / 256); + _writeData(xe % 256); + _writeData(y / 256); + _writeData(y % 256); + _writeData(ye / 256); + _writeData(ye % 256); + _writeData(0x01); // don't see any difference + //_writeData(0x00); // don't see any difference +} + +void GxEPD2_213_Z19c::_PowerOn() +{ + if (!_power_is_on) + { + _writeCommand(0x04); + _waitWhileBusy("_PowerOn", power_on_time); + } + _power_is_on = true; +} + +void GxEPD2_213_Z19c::_PowerOff() +{ + _writeCommand(0x02); // power off + _waitWhileBusy("_PowerOff", power_off_time); + _power_is_on = false; +} + +void GxEPD2_213_Z19c::_InitDisplay() +{ + if (_hibernating) _reset(); + _writeCommand(0x00); // panel setting + _writeData(0x8f); // LUT from OTP + _writeCommand(0x61); // resolution setting + _writeData (WIDTH); + _writeData (HEIGHT >> 8); + _writeData (HEIGHT & 0xFF); + _writeCommand(0x50); // VCOM AND DATA INTERVAL SETTING + _writeData(0x77); // WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 +} + +void GxEPD2_213_Z19c::_Init_Full() +{ + _InitDisplay(); + _PowerOn(); +} + +void GxEPD2_213_Z19c::_Init_Part() +{ + _InitDisplay(); + _PowerOn(); +} + +void GxEPD2_213_Z19c::_Update_Full() +{ + _writeCommand(0x12); //display refresh + _waitWhileBusy("_Update_Full", full_refresh_time); +} + +void GxEPD2_213_Z19c::_Update_Part() +{ + _writeCommand(0x12); //display refresh + _waitWhileBusy("_Update_Part", partial_refresh_time); +} diff --git a/src/epd3c/GxEPD2_213_Z19c.h b/src/epd3c/GxEPD2_213_Z19c.h new file mode 100644 index 0000000..1d55349 --- /dev/null +++ b/src/epd3c/GxEPD2_213_Z19c.h @@ -0,0 +1,75 @@ +// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! +// +// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// Controller: UC8151D : https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +#ifndef _GxEPD2_213_Z19c_H_ +#define _GxEPD2_213_Z19c_H_ + +#include "../GxEPD2_EPD.h" + +class GxEPD2_213_Z19c : public GxEPD2_EPD +{ + public: + // attributes + static const uint16_t WIDTH = 104; + static const uint16_t HEIGHT = 212; + static const GxEPD2::Panel panel = GxEPD2::GDEW0213Z19; + static const bool hasColor = true; + static const bool hasPartialUpdate = true; + static const bool usePartialUpdateWindow = false; // needs be false, controller issue + static const bool hasFastPartialUpdate = false; + static const uint16_t power_on_time = 100; // ms, e.g. 79414us + static const uint16_t power_off_time = 50; // ms, e.g. 39140us + static const uint16_t full_refresh_time = 17000; // ms, e.g. 16788187us + static const uint16_t partial_refresh_time = 17000; // ms, e.g. 16788187us + // constructor + GxEPD2_213_Z19c(int8_t cs, int8_t dc, int8_t rst, int8_t busy); + // methods (virtual) + // Support for Bitmaps (Sprites) to Controller Buffer and to Screen + void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) + void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen + void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) + void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory + // write to controller memory, without screen refresh; x and w should be multiple of 8 + 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); + void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + 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); + 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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 + void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write to controller memory, with screen refresh; x and w should be multiple of 8 + 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); + void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + 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); + 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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 + void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen + void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen + void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time + void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) + private: + void _writeScreenBuffer(uint8_t value); + void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); + void _PowerOn(); + void _PowerOff(); + void _InitDisplay(); + void _Init_Full(); + void _Init_Part(); + void _Update_Full(); + void _Update_Part(); +}; + +#endif diff --git a/src/epd3c/GxEPD2_290_Z13c.cpp b/src/epd3c/GxEPD2_290_Z13c.cpp new file mode 100644 index 0000000..89f5db4 --- /dev/null +++ b/src/epd3c/GxEPD2_290_Z13c.cpp @@ -0,0 +1,390 @@ +// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! +// +// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// Controller: UC8151D : https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +#include "GxEPD2_290_Z13c.h" + +GxEPD2_290_Z13c::GxEPD2_290_Z13c(int8_t cs, int8_t dc, int8_t rst, int8_t busy) : + GxEPD2_EPD(cs, dc, rst, busy, LOW, 20000000, WIDTH, HEIGHT, panel, hasColor, hasPartialUpdate, hasFastPartialUpdate) +{ +} + +void GxEPD2_290_Z13c::clearScreen(uint8_t value) +{ + clearScreen(value, 0xFF); +} + +void GxEPD2_290_Z13c::clearScreen(uint8_t black_value, uint8_t color_value) +{ + _initial_write = false; // initial full screen buffer clean done + _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(0, 0, WIDTH, HEIGHT); + _writeCommand(0x10); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(black_value); + } + _writeCommand(0x13); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(color_value); + } + _Update_Part(); + _writeCommand(0x92); // partial out +} + +void GxEPD2_290_Z13c::writeScreenBuffer(uint8_t value) +{ + writeScreenBuffer(value, 0xFF); +} + +void GxEPD2_290_Z13c::writeScreenBuffer(uint8_t black_value, uint8_t color_value) +{ + _initial_write = false; // initial full screen buffer clean done + _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(0, 0, WIDTH, HEIGHT); + _writeCommand(0x10); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(black_value); + } + _writeCommand(0x13); + for (uint32_t i = 0; i < uint32_t(WIDTH) * uint32_t(HEIGHT) / 8; i++) + { + _writeData(color_value); + } + _writeCommand(0x92); // partial out +} + +void GxEPD2_290_Z13c::writeImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(bitmap, NULL, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_Z13c::writeImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 + int16_t wb = (w + 7) / 8; // width bytes, bitmaps are padded + x -= x % 8; // byte boundary + w = wb * 8; // byte boundary + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + int16_t dx = x1 - x; + int16_t dy = y1 - y; + w1 -= dx; + h1 -= dy; + if ((w1 <= 0) || (h1 <= 0)) return; + _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _writeCommand(0x10); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data = 0xFF; + if (black) + { + // use wb, h of bitmap for index! + int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&black[idx]); +#else + data = black[idx]; +#endif + } + else + { + data = black[idx]; + } + if (invert) data = ~data; + } + _writeData(data); + } + } + _writeCommand(0x13); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data = 0xFF; + if (color) + { + // use wb, h of bitmap for index! + int16_t idx = mirror_y ? j + dx / 8 + ((h - 1 - (i + dy))) * wb : j + dx / 8 + (i + dy) * wb; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&color[idx]); +#else + data = color[idx]; +#endif + } + else + { + data = color[idx]; + } + if (invert) data = ~data; + } + _writeData(data); + } + } + _writeCommand(0x92); // partial out + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 +} + +void GxEPD2_290_Z13c::writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(bitmap, NULL, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); +} + +void GxEPD2_290_Z13c::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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (_initial_write) writeScreenBuffer(); // initial full screen buffer clean + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 + if ((w_bitmap < 0) || (h_bitmap < 0) || (w < 0) || (h < 0)) return; + if ((x_part < 0) || (x_part >= w_bitmap)) return; + if ((y_part < 0) || (y_part >= h_bitmap)) return; + int16_t wb_bitmap = (w_bitmap + 7) / 8; // width bytes, bitmaps are padded + x_part -= x_part % 8; // byte boundary + w = w_bitmap - x_part < w ? w_bitmap - x_part : w; // limit + h = h_bitmap - y_part < h ? h_bitmap - y_part : h; // limit + x -= x % 8; // byte boundary + w = 8 * ((w + 7) / 8); // byte boundary, bitmaps are padded + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + int16_t dx = x1 - x; + int16_t dy = y1 - y; + w1 -= dx; + h1 -= dy; + if ((w1 <= 0) || (h1 <= 0)) return; + if (!_using_partial_mode) _Init_Part(); + _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _writeCommand(0x10); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data; + // use wb_bitmap, h_bitmap of bitmap for index! + int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&black[idx]); +#else + data = black[idx]; +#endif + } + else + { + data = black[idx]; + } + if (invert) data = ~data; + _writeData(data); + } + } + _writeCommand(0x13); + for (int16_t i = 0; i < h1; i++) + { + for (int16_t j = 0; j < w1 / 8; j++) + { + uint8_t data = 0xFF; + if (color) + { + // use wb_bitmap, h_bitmap of bitmap for index! + int16_t idx = mirror_y ? x_part / 8 + j + dx / 8 + ((h_bitmap - 1 - (y_part + i + dy))) * wb_bitmap : x_part / 8 + j + dx / 8 + (y_part + i + dy) * wb_bitmap; + if (pgm) + { +#if defined(__AVR) || defined(ESP8266) || defined(ESP32) + data = pgm_read_byte(&color[idx]); +#else + data = color[idx]; +#endif + } + else + { + data = color[idx]; + } + if (invert) data = ~data; + } + _writeData(data); + } + } + _writeCommand(0x92); // partial out + delay(1); // yield() to avoid WDT on ESP8266 and ESP32 +} + +void GxEPD2_290_Z13c::writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + if (data1) + { + writeImage(data1, x, y, w, h, invert, mirror_y, pgm); + } +} + +void GxEPD2_290_Z13c::drawImage(const uint8_t bitmap[], int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_290_Z13c::drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(bitmap, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_290_Z13c::drawImage(const uint8_t* black, const uint8_t* color, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImage(black, color, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_290_Z13c::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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeImagePart(black, color, x_part, y_part, w_bitmap, h_bitmap, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_290_Z13c::drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert, bool mirror_y, bool pgm) +{ + writeNative(data1, data2, x, y, w, h, invert, mirror_y, pgm); + refresh(x, y, w, h); +} + +void GxEPD2_290_Z13c::refresh(bool partial_update_mode) +{ + if (partial_update_mode) refresh(0, 0, WIDTH, HEIGHT); + else _Update_Full(); +} + +void GxEPD2_290_Z13c::refresh(int16_t x, int16_t y, int16_t w, int16_t h) +{ + x -= x % 8; // byte boundary + w -= w % 8; // byte boundary + int16_t x1 = x < 0 ? 0 : x; // limit + int16_t y1 = y < 0 ? 0 : y; // limit + int16_t w1 = x + w < int16_t(WIDTH) ? w : int16_t(WIDTH) - x; // limit + int16_t h1 = y + h < int16_t(HEIGHT) ? h : int16_t(HEIGHT) - y; // limit + w1 -= x1 - x; + h1 -= y1 - y; + _Init_Part(); + if (usePartialUpdateWindow) _writeCommand(0x91); // partial in + _setPartialRamArea(x1, y1, w1, h1); + _Update_Part(); + if (usePartialUpdateWindow) _writeCommand(0x92); // partial out +} + +void GxEPD2_290_Z13c::powerOff() +{ + _PowerOff(); +} + +void GxEPD2_290_Z13c::hibernate() +{ + _PowerOff(); + if (_rst >= 0) + { + _writeCommand(0x07); // deep sleep + _writeData(0xA5); // check code + _hibernating = true; + } +} + +void GxEPD2_290_Z13c::_setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h) +{ + //Serial.print("_setPartialRamArea("); Serial.print(x); Serial.print(", "); Serial.print(y); Serial.print(", "); Serial.print(w); Serial.print(", "); Serial.print(h); Serial.println(")"); + uint16_t xe = (x + w - 1) | 0x0007; // byte boundary inclusive (last byte) + uint16_t ye = y + h - 1; + x &= 0xFFF8; // byte boundary + _writeCommand(0x90); // partial window + //_writeData(x / 256); + _writeData(x % 256); + //_writeData(xe / 256); + _writeData(xe % 256); + _writeData(y / 256); + _writeData(y % 256); + _writeData(ye / 256); + _writeData(ye % 256); + //_writeData(0x01); // don't see any difference + _writeData(0x00); // don't see any difference +} + +void GxEPD2_290_Z13c::_PowerOn() +{ + if (!_power_is_on) + { + _writeCommand(0x04); + _waitWhileBusy("_PowerOn", power_on_time); + } + _power_is_on = true; +} + +void GxEPD2_290_Z13c::_PowerOff() +{ + _writeCommand(0x50); + _writeData(0xf7); // border floating + _writeCommand(0x02); // power off + _waitWhileBusy("_PowerOff", power_off_time); + _power_is_on = false; +} + +void GxEPD2_290_Z13c::_InitDisplay() +{ + if (_hibernating) _reset(); + _writeCommand(0x00); // panel setting + _writeData(0x8f); // LUT from OTP + _writeCommand(0x61); // resolution setting + _writeData (WIDTH); + _writeData (HEIGHT >> 8); + _writeData (HEIGHT & 0xFF); + _writeCommand(0x50); // VCOM AND DATA INTERVAL SETTING + _writeData(0x77); // WBmode:VBDF 17|D7 VBDW 97 VBDB 57 WBRmode:VBDF F7 VBDW 77 VBDB 37 VBDR B7 +} + +void GxEPD2_290_Z13c::_Init_Full() +{ + _InitDisplay(); + _PowerOn(); +} + +void GxEPD2_290_Z13c::_Init_Part() +{ + _InitDisplay(); + _PowerOn(); +} + +void GxEPD2_290_Z13c::_Update_Full() +{ + _writeCommand(0x12); //display refresh + _waitWhileBusy("_Update_Full", full_refresh_time); +} + +void GxEPD2_290_Z13c::_Update_Part() +{ + _writeCommand(0x12); //display refresh + _waitWhileBusy("_Update_Part", partial_refresh_time); +} diff --git a/src/epd3c/GxEPD2_290_Z13c.h b/src/epd3c/GxEPD2_290_Z13c.h new file mode 100644 index 0000000..5be7e04 --- /dev/null +++ b/src/epd3c/GxEPD2_290_Z13c.h @@ -0,0 +1,75 @@ +// Display Library for SPI e-paper panels from Dalian Good Display and boards from Waveshare. +// Requires HW SPI and Adafruit_GFX. Caution: these e-papers require 3.3V supply AND data lines! +// +// based on Demo Example from Good Display: http://www.e-paper-display.com/download_list/downloadcategoryid=34&isMode=false.html +// Controller: UC8151D : https://v4.cecdn.yun300.cn/100001_1909185148/UC8151D.pdf +// +// Author: Jean-Marc Zingg +// +// Version: see library.properties +// +// Library: https://github.com/ZinggJM/GxEPD2 + +#ifndef _GxEPD2_290_Z13c_H_ +#define _GxEPD2_290_Z13c_H_ + +#include "../GxEPD2_EPD.h" + +class GxEPD2_290_Z13c : public GxEPD2_EPD +{ + public: + // attributes + static const uint16_t WIDTH = 128; + static const uint16_t HEIGHT = 296; + static const GxEPD2::Panel panel = GxEPD2::GDEH029Z13; + static const bool hasColor = true; + static const bool hasPartialUpdate = true; + static const bool usePartialUpdateWindow = false; // needs be false, controller issue + static const bool hasFastPartialUpdate = false; + static const uint16_t power_on_time = 100; // ms, e.g. 79869us + static const uint16_t power_off_time = 50; // ms, e.g. 39037us + static const uint16_t full_refresh_time = 18000; // ms, e.g. 17812004us + static const uint16_t partial_refresh_time = 18000; // ms, e.g. 17812004us + // constructor + GxEPD2_290_Z13c(int8_t cs, int8_t dc, int8_t rst, int8_t busy); + // methods (virtual) + // Support for Bitmaps (Sprites) to Controller Buffer and to Screen + void clearScreen(uint8_t value = 0xFF); // init controller memory and screen (default white) + void clearScreen(uint8_t black_value, uint8_t color_value); // init controller memory and screen + void writeScreenBuffer(uint8_t value = 0xFF); // init controller memory (default white) + void writeScreenBuffer(uint8_t black_value, uint8_t color_value); // init controller memory + // write to controller memory, without screen refresh; x and w should be multiple of 8 + 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); + void writeImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + 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); + 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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write sprite of native data to controller memory, without screen refresh; x and w should be multiple of 8 + void writeNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write to controller memory, with screen refresh; x and w should be multiple of 8 + 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); + void drawImagePart(const uint8_t bitmap[], int16_t x_part, int16_t y_part, int16_t w_bitmap, int16_t h_bitmap, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + 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); + 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, + int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + // write sprite of native data to controller memory, with screen refresh; x and w should be multiple of 8 + void drawNative(const uint8_t* data1, const uint8_t* data2, int16_t x, int16_t y, int16_t w, int16_t h, bool invert = false, bool mirror_y = false, bool pgm = false); + void refresh(bool partial_update_mode = false); // screen refresh from controller memory to full screen + void refresh(int16_t x, int16_t y, int16_t w, int16_t h); // screen refresh from controller memory, partial screen + void powerOff(); // turns off generation of panel driving voltages, avoids screen fading over time + void hibernate(); // turns powerOff() and sets controller to deep sleep for minimum power use, ONLY if wakeable by RST (rst >= 0) + private: + void _writeScreenBuffer(uint8_t value); + void _setPartialRamArea(uint16_t x, uint16_t y, uint16_t w, uint16_t h); + void _PowerOn(); + void _PowerOff(); + void _InitDisplay(); + void _Init_Full(); + void _Init_Part(); + void _Update_Full(); + void _Update_Part(); +}; + +#endif