GxEPD2_NotPagedExample.ino 80 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359
  1. // Display Library example for SPI e-paper panels from Dalian Good Display and boards from Waveshare.
  2. // Requires HW SPI and Adafruit_GFX. Caution: the e-paper panels require 3.3V supply AND data lines!
  3. //
  4. // Display Library based on Demo Example from Good Display: https://www.good-display.com/companyfile/32/
  5. //
  6. // Author: Jean-Marc Zingg
  7. //
  8. // Version: see library.properties
  9. //
  10. // Library: https://github.com/ZinggJM/GxEPD2
  11. // Supporting Arduino Forum Topics (closed, read only):
  12. // Good Display ePaper for Arduino: https://forum.arduino.cc/t/good-display-epaper-for-arduino/419657
  13. // Waveshare e-paper displays with SPI: https://forum.arduino.cc/t/waveshare-e-paper-displays-with-spi/467865
  14. //
  15. // Add new topics in https://forum.arduino.cc/c/using-arduino/displays/23 for new questions and issues
  16. // see GxEPD2_wiring_examples.h for wiring suggestions and examples
  17. // base class GxEPD2_GFX can be used to pass references or pointers to the display instance as parameter, uses ~1.2k more code
  18. // enable or disable GxEPD2_GFX base class
  19. #define ENABLE_GxEPD2_GFX 0
  20. // uncomment next line to use class GFX of library GFX_Root instead of Adafruit_GFX
  21. //#include <GFX.h>
  22. // Note: if you use this with ENABLE_GxEPD2_GFX 1:
  23. // uncomment it in GxEPD2_GFX.h too, or add #include <GFX.h> before any #include <GxEPD2_GFX.h>
  24. #include <GxEPD2_BW.h>
  25. #include <GxEPD2_3C.h>
  26. #include <GxEPD2_4C.h>
  27. #include <GxEPD2_7C.h>
  28. #include <Fonts/FreeMonoBold9pt7b.h>
  29. // select the display class and display driver class in the following file (new style):
  30. // note that many of these selections would require paged display to fit in ram
  31. #include "GxEPD2_display_selection_new_style.h"
  32. // or select the display constructor line below (old style), double commented out selections don't fit in ram:
  33. // note: this list may not get updated with new panels
  34. #if defined (ESP8266)
  35. // select one and adapt to your mapping, can use full buffer size (full HEIGHT)
  36. //GxEPD2_BW<GxEPD2_102, GxEPD2_102::HEIGHT> display(GxEPD2_102(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0102T4 80x128, UC8175
  37. //GxEPD2_BW<GxEPD2_150_BN, GxEPD2_150_BN::HEIGHT> display(GxEPD2_150_BN(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // DEPG0150BN 200x200, SSD1681, TTGO T5 V2.4.1
  38. //GxEPD2_BW<GxEPD2_154, GxEPD2_154::HEIGHT> display(GxEPD2_154(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEP015OC1 200x200, IL3829, no longer available
  39. //GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154D67 200x200, SSD1681
  40. //GxEPD2_BW<GxEPD2_154_T8, GxEPD2_154_T8::HEIGHT> display(GxEPD2_154_T8(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0154T8 152x152, UC8151 (IL0373)
  41. //GxEPD2_BW<GxEPD2_154_M09, GxEPD2_154_M09::HEIGHT> display(GxEPD2_154_M09(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0154M09 200x200, JD79653A
  42. //GxEPD2_BW<GxEPD2_154_M10, GxEPD2_154_M10::HEIGHT> display(GxEPD2_154_M10(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0154M10 152x152, UC8151D
  43. //GxEPD2_BW<GxEPD2_154_GDEY0154D67, GxEPD2_154_GDEY0154D67::HEIGHT> display(GxEPD2_154_GDEY0154D67(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEY0154D67 200x200, SSD1681, (FPC-B001 20.05.21)
  44. //GxEPD2_BW<GxEPD2_213, GxEPD2_213::HEIGHT> display(GxEPD2_213(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDE0213B1 128x250, IL3895, phased out
  45. //GxEPD2_BW<GxEPD2_213_B72, GxEPD2_213_B72::HEIGHT> display(GxEPD2_213_B72(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0213B72 128x250, SSD1675A (IL3897)
  46. //GxEPD2_BW<GxEPD2_213_B73, GxEPD2_213_B73::HEIGHT> display(GxEPD2_213_B73(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0213B73 128x250, SSD1675B
  47. //GxEPD2_BW<GxEPD2_213_B74, GxEPD2_213_B74::HEIGHT> display(GxEPD2_213_B74(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM0213B74 128x250, SSD1680
  48. //GxEPD2_BW<GxEPD2_213_flex, GxEPD2_213_flex::HEIGHT> display(GxEPD2_213_flex(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213I5F 104x212, UC8151 (IL0373)
  49. //GxEPD2_BW<GxEPD2_213_M21, GxEPD2_213_M21::HEIGHT> display(GxEPD2_213_M21(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213M21 104x212, UC8151 (IL0373)
  50. //GxEPD2_BW<GxEPD2_213_T5D, GxEPD2_213_T5D::HEIGHT> display(GxEPD2_213_T5D(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0213T5D 104x212, UC8151D
  51. //GxEPD2_BW<GxEPD2_213_BN, GxEPD2_213_BN::HEIGHT> display(GxEPD2_213_BN(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // DEPG0213BN 128x250, SSD1680, TTGO T5 V2.4.1, V2.3.1
  52. //GxEPD2_BW<GxEPD2_213_GDEY0213B74, GxEPD2_213_GDEY0213B74::HEIGHT> display(GxEPD2_213_GDEY0213B74(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEY0213B74 128x250, SSD1680, (FPC-A002 20.04.08)
  53. //GxEPD2_BW<GxEPD2_260, GxEPD2_260::HEIGHT> display(GxEPD2_260(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW026T0 152x296, UC8151 (IL0373)
  54. //GxEPD2_BW<GxEPD2_260_M01, GxEPD2_260_M01::HEIGHT> display(GxEPD2_260_M01(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW026M01 152x296, UC8151 (IL0373)
  55. //GxEPD2_BW<GxEPD2_266_BN, GxEPD2_266_BN::HEIGHT> display(GxEPD2_266_BN(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // DEPG0266BN 152x296, SSD1680, TTGO T5 V2.66 / T92_V1.0
  56. //GxEPD2_BW<GxEPD2_270, GxEPD2_270::HEIGHT> display(GxEPD2_270(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW027W3 176x264, EK79652 (IL91874)
  57. //GxEPD2_BW<GxEPD2_270_GDEY027T91, GxEPD2_270_GDEY027T91::HEIGHT> display(GxEPD2_270_GDEY027T91(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEY027T91 176x264, SSD1680
  58. //GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT> display(GxEPD2_290(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH029A1 128x296, SSD1608 (IL3820)
  59. //GxEPD2_BW<GxEPD2_290_T5, GxEPD2_290_T5::HEIGHT> display(GxEPD2_290_T5(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029T5 128x296, UC8151 (IL0373)
  60. //GxEPD2_BW<GxEPD2_290_T5D, GxEPD2_290_T5D::HEIGHT> display(GxEPD2_290_T5D(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029T5D 128x296, UC8151D
  61. //GxEPD2_BW<GxEPD2_290_I6FD, GxEPD2_290_I6FD::HEIGHT> display(GxEPD2_290_I6FD(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029I6FD 128x296, UC8151D
  62. //GxEPD2_BW<GxEPD2_290_T94, GxEPD2_290_T94::HEIGHT> display(GxEPD2_290_T94(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029T94 128x296, SSD1680
  63. //GxEPD2_BW<GxEPD2_290_T94_V2, GxEPD2_290_T94_V2::HEIGHT> display(GxEPD2_290_T94_V2(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEM029T94 128x296, SSD1680, Waveshare 2.9" V2 variant
  64. //GxEPD2_BW<GxEPD2_290_BS, GxEPD2_290_BS::HEIGHT> display(GxEPD2_290_BS(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // DEPG0290BS 128x296, SSD1680
  65. //GxEPD2_BW<GxEPD2_290_M06, GxEPD2_290_M06::HEIGHT> display(GxEPD2_290_M06(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW029M06 128x296, UC8151D
  66. //GxEPD2_BW<GxEPD2_290_GDEY029T94, GxEPD2_290_GDEY029T94::HEIGHT> display(GxEPD2_290_GDEY029T94(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEY029T94 128x296, SSD1680, (FPC-A005 20.06.15)
  67. //GxEPD2_BW<GxEPD2_310_GDEQ031T10, GxEPD2_310_GDEQ031T10::HEIGHT> display(GxEPD2_310_GDEQ031T10(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEQ031T10 240x320, UC8253, (no inking, backside mark KEGMO 3100)
  68. //GxEPD2_BW<GxEPD2_371, GxEPD2_371::HEIGHT> display(GxEPD2_371(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0371W7 240x416, UC8171 (IL0324)
  69. //GxEPD2_BW<GxEPD2_370_TC1, GxEPD2_370_TC1::HEIGHT> display(GxEPD2_370_TC1(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // ED037TC1 280x480, SSD1677, Waveshare 3.7"
  70. //GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> display(GxEPD2_420(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW042T2 400x300, UC8176 (IL0398)
  71. //GxEPD2_BW<GxEPD2_420_M01, GxEPD2_420_M01::HEIGHT> display(GxEPD2_420_M01(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW042M01 400x300, UC8176 (IL0398)
  72. //GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> display(GxEPD2_420_GDEY042T81(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); GDEY042T81, 400x300, SSD1683 (no inking)
  73. //GxEPD2_BW<GxEPD2_426_GDEQ0426T82, GxEPD2_426_GDEQ0426T82::HEIGHT> display(GxEPD2_426_GDEQ0426T82(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEY042T81, 400x300, SSD1683 (no inking)
  74. // can use only half buffer size
  75. ////GxEPD2_BW < GxEPD2_583, GxEPD2_583::HEIGHT / 2 > display(GxEPD2_583(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
  76. ////GxEPD2_BW < GxEPD2_583_T8, GxEPD2_583_T8::HEIGHT / 2 > display(GxEPD2_583_T8(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
  77. ////GxEPD2_BW < GxEPD2_750, GxEPD2_750::HEIGHT / 2 > display(GxEPD2_750(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
  78. ////GxEPD2_BW < GxEPD2_750_T7, GxEPD2_750_T7::HEIGHT / 2 > display(GxEPD2_750_T7(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW075T7 800x480
  79. // 3-color e-papers
  80. //GxEPD2_3C<GxEPD2_154c, GxEPD2_154c::HEIGHT> display(GxEPD2_154c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW0154Z04 no longer available
  81. //GxEPD2_3C<GxEPD2_154_Z90c, GxEPD2_154_Z90c::HEIGHT> display(GxEPD2_154_Z90c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEH0154Z90
  82. //GxEPD2_3C<GxEPD2_213c, GxEPD2_213c::HEIGHT> display(GxEPD2_213c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
  83. //GxEPD2_3C<GxEPD2_290c, GxEPD2_290c::HEIGHT> display(GxEPD2_290c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
  84. //GxEPD2_3C<GxEPD2_270c, GxEPD2_270c::HEIGHT> display(GxEPD2_270c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
  85. // can use only half buffer size
  86. ////GxEPD2_3C<GxEPD2_420c, GxEPD2_420c::HEIGHT / 2> display(GxEPD2_420c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
  87. // can use only quarter buffer size
  88. ////GxEPD2_3C < GxEPD2_583c, GxEPD2_583c::HEIGHT / 4 > display(GxEPD2_583c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
  89. ////GxEPD2_3C<GxEPD2_750c, GxEPD2_750c::HEIGHT / 4> display(GxEPD2_750c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4));
  90. ////GxEPD2_3C < GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT / 4 > display(GxEPD2_750c_Z08(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEW075Z08 800x480
  91. // 4-color e-paper
  92. //GxEPD2_4C<GxEPD2_266c_GDEY0266F51H, GxEPD2_266c_GDEY0266F51H::HEIGHT> display(GxEPD2_266c_GDEY0266F51H(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEY029F51H 168x384, JD79667 (FPC-H004 22.03.24)
  93. //GxEPD2_4C<GxEPD2_290c_GDEY029F51H, GxEPD2_290c_GDEY029F51H::HEIGHT> display(GxEPD2_290c_GDEY029F51H(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEY029F51H 168x384, JD79667 (FPC-H004 22.03.24)
  94. //GxEPD2_4C<GxEPD2_290c_GDEY029F51, GxEPD2_290c_GDEY029F51::HEIGHT> display(GxEPD2_290c_GDEY029F51(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEY029F51 128x296, JD79667 (BWRY)
  95. //GxEPD2_4C<GxEPD2_300c, GxEPD2_300c::HEIGHT> display(GxEPD2_300c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // Waveshare 3.00" 4-color
  96. //GxEPD2_4C<GxEPD2_420c_GDEY0420F51, GxEPD2_420c_GDEY0420F51::HEIGHT> display(GxEPD2_420c_GDEY0420F51(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // GDEY029F51H 168x384, JD79667 (FPC-H004 22.03.24)
  97. //GxEPD2_4C<GxEPD2_437c, GxEPD2_437c::HEIGHT> display(GxEPD2_437c(/*CS=D8*/ SS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4)); // Waveshare 4.37" 4-color
  98. // grey levels parallel IF e-papers on Waveshare e-Paper IT8951 Driver HAT
  99. // HRDY -> 4, RST -> 2, CS -> SS(15), SCK -> SCK(14), MOSI -> MOSI(D7(13)), MISO -> MISO(D6(12)), GND -> GND, 5V -> 5V
  100. // note: 5V supply needs to be exact and strong; 5V pin of USB powered Wemos D1 mini doesn't work!
  101. ////GxEPD2_BW<GxEPD2_it60, GxEPD2_it60::HEIGHT / 8> display(GxEPD2_it60(/*CS=5*/ SS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 4));
  102. ////GxEPD2_BW < GxEPD2_it60_1448x1072, GxEPD2_it60_1448x1072::HEIGHT / 32 > display(GxEPD2_it60_1448x1072(/*CS=5*/ SS, /*DC=*/ 0, /*RST=*/ 2, /*BUSY=*/ 4));
  103. // ***** for mapping of Waveshare e-Paper ESP8266 Driver Board *****
  104. // select one , can use full buffer size (full HEIGHT)
  105. //GxEPD2_BW<GxEPD2_150_BN, GxEPD2_150_BN::HEIGHT> display(GxEPD2_150_BN(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // DEPG0150BN 200x200, SSD1681, TTGO T5 V2.4.1
  106. //GxEPD2_BW<GxEPD2_154, GxEPD2_154::HEIGHT> display(GxEPD2_154(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEP015OC1 200x200, IL3829, no longer available
  107. //GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0154D67 200x200, SSD1681
  108. //GxEPD2_BW<GxEPD2_154_T8, GxEPD2_154_T8::HEIGHT> display(GxEPD2_154_T8(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0154T8 152x152, UC8151 (IL0373)
  109. //GxEPD2_BW<GxEPD2_154_M09, GxEPD2_154_M09::HEIGHT> display(GxEPD2_154_M09(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0154M09 200x200, JD79653A
  110. //GxEPD2_BW<GxEPD2_154_M10, GxEPD2_154_M10::HEIGHT> display(GxEPD2_154_M10(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0154M10 152x152, UC8151D
  111. //GxEPD2_BW<GxEPD2_154_GDEY0154D67, GxEPD2_154_GDEY0154D67::HEIGHT> display(GxEPD2_154_GDEY0154D67(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEY0154D67 200x200, SSD1681, (FPC-B001 20.05.21)
  112. //GxEPD2_BW<GxEPD2_213, GxEPD2_213::HEIGHT> display(GxEPD2_213(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDE0213B1 128x250, IL3895, phased out
  113. //GxEPD2_BW<GxEPD2_213_B72, GxEPD2_213_B72::HEIGHT> display(GxEPD2_213_B72(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0213B72 128x250, SSD1675A (IL3897)
  114. //GxEPD2_BW<GxEPD2_213_B73, GxEPD2_213_B73::HEIGHT> display(GxEPD2_213_B73(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0213B73 128x250, SSD1675B
  115. //GxEPD2_BW<GxEPD2_213_B74, GxEPD2_213_B74::HEIGHT> display(GxEPD2_213_B74(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM0213B74 128x250, SSD1680
  116. //GxEPD2_BW<GxEPD2_213_flex, GxEPD2_213_flex::HEIGHT> display(GxEPD2_213_flex(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213I5F 104x212, UC8151 (IL0373)
  117. //GxEPD2_BW<GxEPD2_213_M21, GxEPD2_213_M21::HEIGHT> display(GxEPD2_213_M21(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213M21 104x212, UC8151 (IL0373)
  118. //GxEPD2_BW<GxEPD2_213_T5D, GxEPD2_213_T5D::HEIGHT> display(GxEPD2_213_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0213T5D 104x212, UC8151D
  119. //GxEPD2_BW<GxEPD2_213_BN, GxEPD2_213_BN::HEIGHT> display(GxEPD2_213_BN(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // DEPG0213BN 128x250, SSD1680, TTGO T5 V2.4.1, V2.3.1
  120. //GxEPD2_BW<GxEPD2_213_GDEY0213B74, GxEPD2_213_GDEY0213B74::HEIGHT> display(GxEPD2_213_GDEY0213B74(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEY0213B74 128x250, SSD1680, (FPC-A002 20.04.08)
  121. //GxEPD2_BW<GxEPD2_260, GxEPD2_260::HEIGHT> display(GxEPD2_260(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW026T0 152x296, UC8151 (IL0373)
  122. //GxEPD2_BW<GxEPD2_260_M01, GxEPD2_260_M01::HEIGHT> display(GxEPD2_260_M01(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW026M01 152x296, UC8151 (IL0373)
  123. //GxEPD2_BW<GxEPD2_266_BN, GxEPD2_266_BN::HEIGHT> display(GxEPD2_266_BN(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // DEPG0266BN 152x296, SSD1680, TTGO T5 V2.66 / T92_V1.0
  124. //GxEPD2_BW<GxEPD2_270, GxEPD2_270::HEIGHT> display(GxEPD2_270(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW027W3 176x264, EK79652 (IL91874)
  125. //GxEPD2_BW<GxEPD2_270_GDEY027T91, GxEPD2_270_GDEY027T91::HEIGHT> display(GxEPD2_270_GDEY027T91(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEY027T91 176x264, SSD1680
  126. //GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT> display(GxEPD2_290(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH029A1 128x296, SSD1608 (IL3820)
  127. //GxEPD2_BW<GxEPD2_290_T5, GxEPD2_290_T5::HEIGHT> display(GxEPD2_290_T5(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029T5 128x296, UC8151 (IL0373)
  128. //GxEPD2_BW<GxEPD2_290_T5D, GxEPD2_290_T5D::HEIGHT> display(GxEPD2_290_T5D(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029T5D 128x296, UC8151D
  129. //GxEPD2_BW<GxEPD2_290_I6FD, GxEPD2_290_I6FD::HEIGHT> display(GxEPD2_290_I6FD(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029I6FD 128x296, UC8151D
  130. //GxEPD2_BW<GxEPD2_290_T94, GxEPD2_290_T94::HEIGHT> display(GxEPD2_290_T94(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029T94 128x296, SSD1680
  131. //GxEPD2_BW<GxEPD2_290_T94_V2, GxEPD2_290_T94_V2::HEIGHT> display(GxEPD2_290_T94_V2(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEM029T94 128x296, SSD1680, Waveshare 2.9" V2 variant
  132. //GxEPD2_BW<GxEPD2_290_BS, GxEPD2_290_BS::HEIGHT> display(GxEPD2_290_BS(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // DEPG0290BS 128x296, SSD1680
  133. //GxEPD2_BW<GxEPD2_290_M06, GxEPD2_290_M06::HEIGHT> display(GxEPD2_290_M06(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW029M06 128x296, UC8151D
  134. //GxEPD2_BW<GxEPD2_290_GDEY029T94, GxEPD2_290_GDEY029T94::HEIGHT> display(GxEPD2_290_GDEY029T94(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEY029T94 128x296, SSD1680, (FPC-A005 20.06.15)
  135. //GxEPD2_BW<GxEPD2_310_GDEQ031T10, GxEPD2_310_GDEQ031T10::HEIGHT> display(GxEPD2_310_GDEQ031T10(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEQ031T10 240x320, UC8253, (no inking, backside mark KEGMO 3100)
  136. //GxEPD2_BW<GxEPD2_371, GxEPD2_371::HEIGHT> display(GxEPD2_371(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0371W7 240x416, UC8171 (IL0324)
  137. //GxEPD2_BW<GxEPD2_370_TC1, GxEPD2_370_TC1::HEIGHT> display(GxEPD2_370_TC1(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // ED037TC1 280x480, SSD1677, Waveshare 3.7"
  138. //GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> display(GxEPD2_420(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW042T2 400x300, UC8176 (IL0398)
  139. //GxEPD2_BW<GxEPD2_420_M01, GxEPD2_420_M01::HEIGHT> display(GxEPD2_420_M01(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW042M01 400x300, UC8176 (IL0398)
  140. //GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> display(GxEPD2_420_GDEY042T81(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); GDEY042T81, 400x300, SSD1683 (no inking)
  141. //GxEPD2_BW<GxEPD2_426_GDEQ0426T82, GxEPD2_426_GDEQ0426T82::HEIGHT> display(GxEPD2_426_GDEQ0426T82(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEQ0426T82 480x800, SSD1677 (P426010-MF1-A)
  142. // can use only half buffer size
  143. ////GxEPD2_BW < GxEPD2_583, GxEPD2_583::HEIGHT / 2 > display(GxEPD2_583(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5));
  144. ////GxEPD2_BW < GxEPD2_583_T8, GxEPD2_583_T8::HEIGHT / 2 > display(GxEPD2_583_T8(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5));
  145. ////GxEPD2_BW < GxEPD2_750, GxEPD2_750::HEIGHT / 2 > display(GxEPD2_750(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5));
  146. ////GxEPD2_BW < GxEPD2_750_T7, GxEPD2_750_T7::HEIGHT / 2 > display(GxEPD2_750_T7(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW075T7 800x480
  147. // 3-color e-papers
  148. //GxEPD2_3C<GxEPD2_154c, GxEPD2_154c::HEIGHT> display(GxEPD2_154c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW0154Z04 no longer available
  149. //GxEPD2_3C<GxEPD2_154_Z90c, GxEPD2_154_Z90c::HEIGHT> display(GxEPD2_154_Z90c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH0154Z90
  150. //GxEPD2_3C<GxEPD2_213c, GxEPD2_213c::HEIGHT> display(GxEPD2_213c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5));
  151. //GxEPD2_3C<GxEPD2_290c, GxEPD2_290c::HEIGHT> display(GxEPD2_290c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5));
  152. //GxEPD2_3C<GxEPD2_270c, GxEPD2_270c::HEIGHT> display(GxEPD2_270c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5));
  153. // can use only half buffer size
  154. ////GxEPD2_3C<GxEPD2_420c, GxEPD2_420c::HEIGHT / 2> display(GxEPD2_420c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5));
  155. // 4-color e-paper
  156. //GxEPD2_4C<GxEPD2_266c_GDEY0266F51H, GxEPD2_266c_GDEY0266F51H::HEIGHT> display(GxEPD2_266c_GDEY0266F51H(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEY0266F51H 184x360, JD79667 (FPC-H006 22.04.02)
  157. //GxEPD2_4C<GxEPD2_290c_GDEY029F51H, GxEPD2_290c_GDEY029F51H::HEIGHT> display(GxEPD2_290c_GDEY029F51H(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEY029F51H 168x384, JD79667 (FPC-H004 22.03.24)
  158. //GxEPD2_4C<GxEPD2_290c_GDEY029F51, GxEPD2_290c_GDEY029F51::HEIGHT> display(GxEPD2_290c_GDEY029F51(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEY029F51 128x296, JD79667 (BWRY)
  159. //GxEPD2_4C<GxEPD2_300c, GxEPD2_300c::HEIGHT> display(GxEPD2_300c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // Waveshare 3.00" 4-color
  160. //GxEPD2_4C<GxEPD2_420c_GDEY0420F51, GxEPD2_420c_GDEY0420F51::HEIGHT> display(GxEPD2_420c_GDEY0420F51(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEY0420F51 400x300, HX8717 (no inking)
  161. //GxEPD2_4C < GxEPD2_437c, GxEPD2_437c::HEIGHT / 4 > display(GxEPD2_437c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // Waveshare 4.37" 4-color
  162. // can use only quarter buffer size
  163. ////GxEPD2_3C<GxEPD2_583c, GxEPD2_583c::HEIGHT / 4> display(GxEPD2_583c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5));
  164. ////GxEPD2_3C<GxEPD2_750c, GxEPD2_750c::HEIGHT / 4> display(GxEPD2_750c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5));
  165. ////GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT / 4> display(GxEPD2_750c_Z08(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEW075Z08 800x480
  166. ////GxEPD2_3C<GxEPD2_750c_Z90, GxEPD2_750c_Z90::HEIGHT / 4> display(GxEPD2_750c_Z90(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // GDEH075Z90 880x528
  167. // 7-color e-paper
  168. ////GxEPD2_7C < GxEPD2_565c, GxEPD2_565c::HEIGHT / 4 > display(GxEPD2_565c(/*CS=15*/ SS, /*DC=4*/ 4, /*RST=2*/ 2, /*BUSY=5*/ 5)); // Waveshare 5.65" 7-color
  169. #endif
  170. #if defined(ESP32)
  171. // select one and adapt to your mapping, can use full buffer size (full HEIGHT)
  172. //GxEPD2_BW<GxEPD2_102, GxEPD2_102::HEIGHT> display(GxEPD2_102(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0102T4 80x128, UC8175
  173. //GxEPD2_BW<GxEPD2_150_BN, GxEPD2_150_BN::HEIGHT> display(GxEPD2_150_BN(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // DEPG0150BN 200x200, SSD1681, TTGO T5 V2.4.1
  174. //GxEPD2_BW<GxEPD2_154, GxEPD2_154::HEIGHT> display(GxEPD2_154(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEP015OC1 200x200, IL3829, no longer available
  175. //GxEPD2_BW<GxEPD2_154_D67, GxEPD2_154_D67::HEIGHT> display(GxEPD2_154_D67(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0154D67 200x200, SSD1681
  176. //GxEPD2_BW<GxEPD2_154_T8, GxEPD2_154_T8::HEIGHT> display(GxEPD2_154_T8(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0154T8 152x152, UC8151 (IL0373)
  177. //GxEPD2_BW<GxEPD2_154_M09, GxEPD2_154_M09::HEIGHT> display(GxEPD2_154_M09(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0154M09 200x200, JD79653A
  178. //GxEPD2_BW<GxEPD2_154_M10, GxEPD2_154_M10::HEIGHT> display(GxEPD2_154_M10(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0154M10 152x152, UC8151D
  179. //GxEPD2_BW<GxEPD2_154_GDEY0154D67, GxEPD2_154_GDEY0154D67::HEIGHT> display(GxEPD2_154_GDEY0154D67(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY0154D67 200x200, SSD1681, (FPC-B001 20.05.21)
  180. //GxEPD2_BW<GxEPD2_213, GxEPD2_213::HEIGHT> display(GxEPD2_213(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDE0213B1 128x250, IL3895, phased out
  181. //GxEPD2_BW<GxEPD2_213_B72, GxEPD2_213_B72::HEIGHT> display(GxEPD2_213_B72(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0213B72 128x250, SSD1675A (IL3897)
  182. //GxEPD2_BW<GxEPD2_213_B73, GxEPD2_213_B73::HEIGHT> display(GxEPD2_213_B73(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0213B73 128x250, SSD1675B
  183. //GxEPD2_BW<GxEPD2_213_B74, GxEPD2_213_B74::HEIGHT> display(GxEPD2_213_B74(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM0213B74 128x250, SSD1680
  184. //GxEPD2_BW<GxEPD2_213_flex, GxEPD2_213_flex::HEIGHT> display(GxEPD2_213_flex(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213I5F 104x212, UC8151 (IL0373)
  185. //GxEPD2_BW<GxEPD2_213_M21, GxEPD2_213_M21::HEIGHT> display(GxEPD2_213_M21(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213M21 104x212, UC8151 (IL0373)
  186. //GxEPD2_BW<GxEPD2_213_T5D, GxEPD2_213_T5D::HEIGHT> display(GxEPD2_213_T5D(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213T5D 104x212, UC8151D
  187. //GxEPD2_BW<GxEPD2_213_BN, GxEPD2_213_BN::HEIGHT> display(GxEPD2_213_BN(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // DEPG0213BN 128x250, SSD1680, TTGO T5 V2.4.1, V2.3.1
  188. //GxEPD2_BW<GxEPD2_213_GDEY0213B74, GxEPD2_213_GDEY0213B74::HEIGHT> display(GxEPD2_213_GDEY0213B74(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY0213B74 128x250, SSD1680, (FPC-A002 20.04.08)
  189. //GxEPD2_BW<GxEPD2_260, GxEPD2_260::HEIGHT> display(GxEPD2_260(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW026T0 152x296, UC8151 (IL0373)
  190. //GxEPD2_BW<GxEPD2_260_M01, GxEPD2_260_M01::HEIGHT> display(GxEPD2_260_M01(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW026M01 152x296, UC8151 (IL0373)
  191. //GxEPD2_BW<GxEPD2_266_BN, GxEPD2_266_BN::HEIGHT> display(GxEPD2_266_BN(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // DEPG0266BN 152x296, SSD1680, TTGO T5 V2.4.1
  192. //GxEPD2_BW<GxEPD2_270, GxEPD2_270::HEIGHT> display(GxEPD2_270(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW027W3 176x264, EK79652 (IL91874)
  193. //GxEPD2_BW<GxEPD2_270_GDEY027T91, GxEPD2_270_GDEY027T91::HEIGHT> display(GxEPD2_270_GDEY027T91(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY027T91 176x264, SSD1680
  194. //GxEPD2_BW<GxEPD2_290, GxEPD2_290::HEIGHT> display(GxEPD2_290(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH029A1 128x296, SSD1608 (IL3820)
  195. //GxEPD2_BW<GxEPD2_290_T5, GxEPD2_290_T5::HEIGHT> display(GxEPD2_290_T5(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029T5 128x296, UC8151 (IL0373)
  196. //GxEPD2_BW<GxEPD2_290_T5D, GxEPD2_290_T5D::HEIGHT> display(GxEPD2_290_T5D(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029T5D 128x296, UC8151D
  197. //GxEPD2_BW<GxEPD2_290_I6FD, GxEPD2_290_I6FD::HEIGHT> display(GxEPD2_290_I6FD(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029I6FD 128x296, UC8151D
  198. //GxEPD2_BW<GxEPD2_290_T94, GxEPD2_290_T94::HEIGHT> display(GxEPD2_290_T94(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029T94 128x296, SSD1680
  199. //GxEPD2_BW<GxEPD2_290_T94_V2, GxEPD2_290_T94_V2::HEIGHT> display(GxEPD2_290_T94_V2(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029T94 128x296, SSD1680, Waveshare 2.9" V2 variant
  200. //GxEPD2_BW<GxEPD2_290_BS, GxEPD2_290_BS::HEIGHT> display(GxEPD2_290_BS(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // DEPG0290BS 128x296, SSD1680
  201. //GxEPD2_BW<GxEPD2_290_M06, GxEPD2_290_M06::HEIGHT> display(GxEPD2_290_M06(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029M06 128x296, UC8151D
  202. //GxEPD2_BW<GxEPD2_290_GDEY029T94, GxEPD2_290_GDEY029T94::HEIGHT> display(GxEPD2_290_GDEY029T94(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY029T94 128x296, SSD1680, (FPC-A005 20.06.15)
  203. //GxEPD2_BW<GxEPD2_310_GDEQ031T10, GxEPD2_310_GDEQ031T10::HEIGHT> display(GxEPD2_310_GDEQ031T10(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEQ031T10 240x320, UC8253, (no inking, backside mark KEGMO 3100)
  204. //GxEPD2_BW<GxEPD2_371, GxEPD2_371::HEIGHT> display(GxEPD2_371(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0371W7 240x416, UC8171 (IL0324)
  205. //GxEPD2_BW<GxEPD2_370_TC1, GxEPD2_370_TC1::HEIGHT> display(GxEPD2_370_TC1(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // ED037TC1 280x480, SSD1677, Waveshare 3.7"
  206. //GxEPD2_BW<GxEPD2_420, GxEPD2_420::HEIGHT> display(GxEPD2_420(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW042T2 400x300, UC8176 (IL0398)
  207. //GxEPD2_BW<GxEPD2_420_M01, GxEPD2_420_M01::HEIGHT> display(GxEPD2_420_M01(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW042M01 400x300, UC8176 (IL0398)
  208. //GxEPD2_BW<GxEPD2_420_GDEY042T81, GxEPD2_420_GDEY042T81::HEIGHT> display(GxEPD2_420_GDEY042T81(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); GDEY042T81, 400x300, SSD1683 (no inking)
  209. //GxEPD2_BW<GxEPD2_426_GDEQ0426T82, GxEPD2_426_GDEQ0426T82::HEIGHT> display(GxEPD2_426_GDEQ0426T82(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEQ0426T82 480x800, SSD1677 (P426010-MF1-A)
  210. //GxEPD2_BW<GxEPD2_583, GxEPD2_583::HEIGHT> display(GxEPD2_583(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0583T7 600x448, UC8159c (IL0371)
  211. //GxEPD2_BW<GxEPD2_583_T8, GxEPD2_583_T8::HEIGHT> display(GxEPD2_583_T8(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0583T8 648x480, EK79655 (GD7965)
  212. //GxEPD2_BW<GxEPD2_583_GDEQ0583T31, GxEPD2_583_GDEQ0583T31::HEIGHT> display(GxEPD2_583_GDEQ0583T31(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEQ0583T31 648x480, UC8179, (P583010-MF1-B)
  213. //GxEPD2_BW<GxEPD2_750, GxEPD2_750::HEIGHT> display(GxEPD2_750(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW075T8 640x384, UC8159c (IL0371)
  214. //GxEPD2_BW<GxEPD2_750_T7, GxEPD2_750_T7::HEIGHT> display(GxEPD2_750_T7(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW075T7 800x480, EK79655 (GD7965)
  215. //GxEPD2_BW<GxEPD2_750_YT7, GxEPD2_750_YT7::HEIGHT> display(GxEPD2_750_YT7(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY075T7 800x480, UC8179 (GD7965)
  216. ////GxEPD2_BW < GxEPD2_1085_GDEM1085T51, GxEPD2_1085_GDEM1085T51::HEIGHT / 2> display(GxEPD2_1085_GDEM1085T51(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4, /*CS2=*/ 2)); // GDEM1085T51 1360x480, JD79686AB, (FPC8617)
  217. ////GxEPD2_BW < GxEPD2_1160_T91, GxEPD2_1160_T91::HEIGHT / 2> display(GxEPD2_1160_T91(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH116T91 960x640, SSD1677
  218. // 3-color e-papers
  219. //GxEPD2_3C<GxEPD2_154c, GxEPD2_154c::HEIGHT> display(GxEPD2_154c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0154Z04 200x200, IL0376F, no longer available
  220. //GxEPD2_3C<GxEPD2_154_Z90c, GxEPD2_154_Z90c::HEIGHT> display(GxEPD2_154_Z90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0154Z90 200x200, SSD1681
  221. //GxEPD2_3C<GxEPD2_213c, GxEPD2_213c::HEIGHT> display(GxEPD2_213c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0213Z16 104x212, UC8151 (IL0373)
  222. //GxEPD2_3C<GxEPD2_213_Z19c, GxEPD2_213_Z19c::HEIGHT> display(GxEPD2_213_Z19c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0213Z19 104x212, UC8151D
  223. //GxEPD2_3C<GxEPD2_213_Z98c, GxEPD2_213_Z98c::HEIGHT> display(GxEPD2_213_Z98c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY0213Z98 122x250, SSD1680
  224. //GxEPD2_3C<GxEPD2_266c, GxEPD2_266c::HEIGHT> display(GxEPD2_266c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY0266Z90 152x296, SSD1680
  225. //GxEPD2_3C<GxEPD2_270c, GxEPD2_270c::HEIGHT> display(GxEPD2_270c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW027C44 176x264, IL91874
  226. //GxEPD2_3C<GxEPD2_290c, GxEPD2_290c::HEIGHT> display(GxEPD2_290c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW029Z10 128x296, UC8151 (IL0373)
  227. //GxEPD2_3C<GxEPD2_290_Z13c, GxEPD2_290_Z13c::HEIGHT> display(GxEPD2_290_Z13c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH029Z13 128x296, UC8151D
  228. //GxEPD2_3C<GxEPD2_290_C90c, GxEPD2_290_C90c::HEIGHT> display(GxEPD2_290_C90c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEM029C90 128x296, SSD1680
  229. //GxEPD2_3C<GxEPD2_420c, GxEPD2_420c::HEIGHT> display(GxEPD2_420c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW042Z15 400x300, UC8176 (IL0398)
  230. //GxEPD2_3C<GxEPD2_420c_Z21, GxEPD2_420c_Z21::HEIGHT> display(GxEPD2_420c_Z21(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEQ042Z21 400x300, UC8276
  231. //GxEPD2_3C<GxEPD2_583c, GxEPD2_583c::HEIGHT> display(GxEPD2_583c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0583Z21 600x448, UC8179 (IL0371)
  232. //GxEPD2_3C<GxEPD2_583c_Z83, GxEPD2_583c_Z83::HEIGHT> display(GxEPD2_583c_Z83(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW0583Z83 648x480, GD7965
  233. //GxEPD2_3C<GxEPD2_750c, GxEPD2_750c::HEIGHT> display(GxEPD2_750c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW075Z09 640x384, UC8179 (IL0371)
  234. //GxEPD2_3C<GxEPD2_750c_Z08, GxEPD2_750c_Z08::HEIGHT> display(GxEPD2_750c_Z08(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEW075Z08 800x480, GD7965
  235. ////GxEPD2_3C<GxEPD2_750c_Z90, GxEPD2_750c_Z90::HEIGHT / 2> display(GxEPD2_750c_Z90(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH075Z90 880x528, SSD1677
  236. // 4-color e-paper
  237. //GxEPD2_4C<GxEPD2_266c_GDEY0266F51H, GxEPD2_266c_GDEY0266F51H::HEIGHT> display(GxEPD2_266c_GDEY0266F51H(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY0266F51H 184x360, JD79667 (FPC-H006 22.04.02)
  238. //GxEPD2_4C<GxEPD2_290c_GDEY029F51H, GxEPD2_290c_GDEY029F51H::HEIGHT> display(GxEPD2_290c_GDEY029F51H(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY029F51H 168x384, JD79667 (FPC-H004 22.03.24)
  239. //GxEPD2_4C<GxEPD2_290c_GDEY029F51, GxEPD2_290c_GDEY029F51::HEIGHT> display(GxEPD2_290c_GDEY029F51(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY029F51 128x296, JD79667 (BWRY)
  240. //GxEPD2_4C<GxEPD2_300c, GxEPD2_300c::HEIGHT> display(GxEPD2_300c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // Waveshare 3.00" 4-color
  241. //GxEPD2_4C<GxEPD2_420c_GDEY0420F51, GxEPD2_420c_GDEY0420F51::HEIGHT> display(GxEPD2_420c_GDEY0420F51(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEY0420F51 400x300, HX8717 (no inking)
  242. //GxEPD2_4C<GxEPD2_437c, GxEPD2_437c::HEIGHT> display(GxEPD2_437c(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // Waveshare 4.37" 4-color
  243. // grey levels parallel IF e-papers on Waveshare e-Paper IT8951 Driver HAT
  244. // HRDY -> 4, RST -> 16, CS -> SS(5), SCK -> SCK(18), MOSI -> MOSI(23), MISO -> MISO(19), GND -> GND, 5V -> 5V
  245. // note: 5V supply needs to be exact and strong; 5V over diode from USB (e.g. Wemos D1 mini) doesn't work!
  246. //GxEPD2_BW<GxEPD2_it60, GxEPD2_it60::HEIGHT> display(GxEPD2_it60(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
  247. ////GxEPD2_BW < GxEPD2_it60_1448x1072, GxEPD2_it60_1448x1072::HEIGHT / 4 > display(GxEPD2_it60_1448x1072(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4));
  248. #endif
  249. // can't use package "STMF1 Boards (STM32Duino.com)" (Roger Clark) anymore with Adafruit_GFX, use "STM32 Boards (selected from submenu)" (STMicroelectronics)
  250. #if defined(ARDUINO_ARCH_STM32)
  251. #define Serial Serial1 // for my proto board
  252. #define MAX_DISPLAY_BUFFER_SIZE (16384ul + 184) // ~16k is a good compromise, (16384ul + 184) for GDEY0266F51H
  253. #define MAX_HEIGHT(EPD) (EPD::HEIGHT <= MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8) ? EPD::HEIGHT : MAX_DISPLAY_BUFFER_SIZE / (EPD::WIDTH / 8))
  254. // select one and adapt to your mapping
  255. //GxEPD2_BW<GxEPD2_102, MAX_HEIGHT(GxEPD2_102)> display(GxEPD2_102(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0102T4 80x128, UC8175
  256. //GxEPD2_BW<GxEPD2_150_BN, GxEPD2_150_BN::HEIGHT> display(GxEPD2_150_BN(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // DEPG0150BN 200x200, SSD1681, TTGO T5 V2.4.1
  257. //GxEPD2_BW<GxEPD2_154, MAX_HEIGHT(GxEPD2_154)> display(GxEPD2_154(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEP015OC1 200x200, IL3829, no longer available
  258. //GxEPD2_BW<GxEPD2_154_D67, MAX_HEIGHT(GxEPD2_154_D67)> display(GxEPD2_154_D67(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEH0154D67 200x200, SSD1681
  259. //GxEPD2_BW<GxEPD2_154_T8, MAX_HEIGHT(GxEPD2_154_T8)> display(GxEPD2_154_T8(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0154T8 152x152, UC8151 (IL0373)
  260. //GxEPD2_BW<GxEPD2_154_M09, MAX_HEIGHT(GxEPD2_154_M09)> display(GxEPD2_154_M09(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0154M09 200x200, JD79653A
  261. //GxEPD2_BW<GxEPD2_154_M10, MAX_HEIGHT(GxEPD2_154_M10)> display(GxEPD2_154_M10(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0154M10 152x152, UC8151D
  262. //GxEPD2_BW<GxEPD2_154_GDEY0154D67, MAX_HEIGHT(GxEPD2_154_GDEY0154D67)> display(GxEPD2_154_GDEY0154D67(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY0154D67 200x200, SSD1681, (FPC-B001 20.05.21)
  263. //GxEPD2_BW<GxEPD2_213, MAX_HEIGHT(GxEPD2_213)> display(GxEPD2_213(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDE0213B1 122x250, IL3895, phased out
  264. //GxEPD2_BW<GxEPD2_213_B72, MAX_HEIGHT(GxEPD2_213_B72)> display(GxEPD2_213_B72(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEH0213B72 122x250, SSD1675A (IL3897)
  265. //GxEPD2_BW<GxEPD2_213_B73, MAX_HEIGHT(GxEPD2_213_B73)> display(GxEPD2_213_B73(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEH0213B73 122x250, SSD1675B
  266. //GxEPD2_BW<GxEPD2_213_B74, MAX_HEIGHT(GxEPD2_213_B74)> display(GxEPD2_213_B74(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEM0213B74 122x250, SSD1680
  267. //GxEPD2_BW<GxEPD2_213_flex, MAX_HEIGHT(GxEPD2_213_flex)> display(GxEPD2_213_flex(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0213I5F 104x212, UC8151 (IL0373)
  268. //GxEPD2_BW<GxEPD2_213_M21, MAX_HEIGHT(GxEPD2_213_M21)> display(GxEPD2_213_M21(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0213M21 104x212, UC8151 (IL0373)
  269. //GxEPD2_BW<GxEPD2_213_T5D, MAX_HEIGHT(GxEPD2_213_T5D)> display(GxEPD2_213_T5D(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0213T5D 104x212, UC8151D
  270. //GxEPD2_BW<GxEPD2_213_BN, MAX_HEIGHT(GxEPD2_213_BN)> display(GxEPD2_213_BN(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // DEPG0213BN 122x250, SSD1680, TTGO T5 V2.4.1, V2.3.1
  271. //GxEPD2_BW<GxEPD2_213_GDEY0213B74, MAX_HEIGHT(GxEPD2_213_GDEY0213B74)> display(GxEPD2_213_GDEY0213B74(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY0213B74 122x250, SSD1680, (FPC-A002 20.04.08)
  272. //GxEPD2_BW<GxEPD2_260, MAX_HEIGHT(GxEPD2_260)> display(GxEPD2_260(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW026T0 152x296, UC8151 (IL0373)
  273. //GxEPD2_BW<GxEPD2_260_M01, MAX_HEIGHT(GxEPD2_260_M01)> display(GxEPD2_260_M01(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW026M01 152x296, UC8151 (IL0373)
  274. //GxEPD2_BW<GxEPD2_266_BN, MAX_HEIGHT(GxEPD2_266_BN)> display(GxEPD2_266_BN(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // DEPG0266BN 152x296, SSD1680, TTGO T5 V2.66 / T92_V1.0
  275. //GxEPD2_BW<GxEPD2_270, MAX_HEIGHT(GxEPD2_270)> display(GxEPD2_270(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW027W3 176x264, EK79652 (IL91874)
  276. //GxEPD2_BW<GxEPD2_270_GDEY027T91, MAX_HEIGHT(GxEPD2_270_GDEY027T91)> display(GxEPD2_270_GDEY027T91(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY027T91 176x264, SSD1680
  277. //GxEPD2_BW<GxEPD2_290, MAX_HEIGHT(GxEPD2_290)> display(GxEPD2_290(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEH029A1 128x296, SSD1608 (IL3820)
  278. //GxEPD2_BW<GxEPD2_290_T5, MAX_HEIGHT(GxEPD2_290_T5)> display(GxEPD2_290_T5(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW029T5 128x296, UC8151 (IL0373)
  279. //GxEPD2_BW<GxEPD2_290_T5D, MAX_HEIGHT(GxEPD2_290_T5D)> display(GxEPD2_290_T5D(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW029T5D 128x296, UC8151D
  280. //GxEPD2_BW<GxEPD2_290_I6FD, MAX_HEIGHT(GxEPD2_290_I6FD)> display(GxEPD2_290_I6FD(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW029I6FD 128x296, UC8151D
  281. //GxEPD2_BW<GxEPD2_290_T94, MAX_HEIGHT(GxEPD2_290_T94)> display(GxEPD2_290_T94(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEM029T94 128x296, SSD1680
  282. //GxEPD2_BW<GxEPD2_290_T94_V2, MAX_HEIGHT(GxEPD2_290_T94_V2)> display(GxEPD2_290_T94_V2(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEM029T94 128x296, SSD1680, Waveshare 2.9" V2 variant
  283. //GxEPD2_BW<GxEPD2_290_BS, MAX_HEIGHT(GxEPD2_290_BS)> display(GxEPD2_290_BS(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // DEPG0290BS 128x296, SSD1680
  284. //GxEPD2_BW<GxEPD2_290_M06, MAX_HEIGHT(GxEPD2_290_M06)> display(GxEPD2_290_M06(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW029M06 128x296, UC8151D
  285. //GxEPD2_BW<GxEPD2_290_GDEY029T94, MAX_HEIGHT(GxEPD2_290_GDEY029T94)> display(GxEPD2_290_GDEY029T94(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY029T94 128x296, SSD1680, (FPC-A005 20.06.15)
  286. //GxEPD2_BW<GxEPD2_310_GDEQ031T10, MAX_HEIGHT(GxEPD2_310_GDEQ031T10)> display(GxEPD2_310_GDEQ031T10(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEQ031T10 240x320, UC8253, (no inking, backside mark KEGMO 3100)
  287. //GxEPD2_BW<GxEPD2_371, MAX_HEIGHT(GxEPD2_371)> display(GxEPD2_371(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0371W7 240x416, UC8171 (IL0324)
  288. //GxEPD2_BW<GxEPD2_370_TC1, MAX_HEIGHT(GxEPD2_370_TC1)> display(GxEPD2_370_TC1(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // ED037TC1 280x480, SSD1677, Waveshare 3.7"
  289. //GxEPD2_BW<GxEPD2_420, MAX_HEIGHT(GxEPD2_420)> display(GxEPD2_420(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW042T2 400x300, UC8176 (IL0398)
  290. //GxEPD2_BW<GxEPD2_420_M01, MAX_HEIGHT(GxEPD2_420_M01)> display(GxEPD2_420_M01(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW042M01 400x300, UC8176 (IL0398)
  291. //GxEPD2_BW<GxEPD2_420_GDEY042T81, MAX_HEIGHT(GxEPD2_420_GDEY042T81)> display(GxEPD2_420_GDEY042T81(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); GDEY042T81, 400x300, SSD1683 (no inking)
  292. //GxEPD2_BW<GxEPD2_426_GDEQ0426T82, MAX_HEIGHT(GxEPD2_426_GDEQ0426T82)> display(GxEPD2_426_GDEQ0426T82(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEQ0426T82 480x800, SSD1677 (P426010-MF1-A)
  293. ////GxEPD2_BW<GxEPD2_583, MAX_HEIGHT(GxEPD2_583)> display(GxEPD2_583(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0583T7 600x448, UC8159c (IL0371)
  294. ////GxEPD2_BW <GxEPD2_583_T8, MAX_HEIGHT(GxEPD2_583_T8)> display(GxEPD2_583_T8(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0583T8 648x480, EK79655 (GD7965)
  295. ////GxEPD2_BW<GxEPD2_583_GDEQ0583T31, MAX_HEIGHT(GxEPD2_583_GDEQ0583T31)> display(GxEPD2_583_GDEQ0583T31(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEQ0583T31 648x480, UC8179, (P583010-MF1-B)
  296. ////GxEPD2_BW<GxEPD2_750, MAX_HEIGHT(GxEPD2_750)> display(GxEPD2_750(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW075T8 640x384, UC8159c (IL0371)
  297. ////GxEPD2_BW<GxEPD2_750_T7, MAX_HEIGHT(GxEPD2_750_T7)> display(GxEPD2_750_T7(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW075T7 800x480, EK79655 (GD7965)
  298. ////GxEPD2_BW<GxEPD2_750_GDEY075T7, MAX_HEIGHT(GxEPD2_750_GDEY075T7)> display(GxEPD2_750_GDEY075T7(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY075T7 800x480, UC8179 (GD7965)
  299. ////GxEPD2_BW < GxEPD2_1160_T91, MAX_HEIGHT(GxEPD2_1160_T91)> display(GxEPD2_1160_T91(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEH116T91 960x640, SSD1677
  300. // 3-color e-papers
  301. #define MAX_HEIGHT_3C(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE / 2) / (EPD::WIDTH / 8))
  302. //GxEPD2_3C<GxEPD2_154c, MAX_HEIGHT_3C(GxEPD2_154c)> display(GxEPD2_154c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0154Z04 200x200, IL0376F, no longer available
  303. //GxEPD2_3C<GxEPD2_154_Z90c, MAX_HEIGHT_3C(GxEPD2_154_Z90c)> display(GxEPD2_154_Z90c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEH0154Z90 200x200, SSD1681
  304. //GxEPD2_3C<GxEPD2_213c, MAX_HEIGHT_3C(GxEPD2_213c)> display(GxEPD2_213c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0213Z16 104x212, UC8151 (IL0373)
  305. //GxEPD2_3C<GxEPD2_213_Z19c, MAX_HEIGHT_3C(GxEPD2_213_Z19c)> display(GxEPD2_213_Z19c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEH0213Z19 104x212, UC8151D
  306. //GxEPD2_3C<GxEPD2_213_Z98c, MAX_HEIGHT_3C(GxEPD2_213_Z98c)> display(GxEPD2_213_Z98c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY0213Z98 122x250, SSD1680
  307. //GxEPD2_3C<GxEPD2_266c, MAX_HEIGHT_3C(GxEPD2_266c)> display(GxEPD2_266c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY0266Z90 152x296, SSD1680
  308. //GxEPD2_3C<GxEPD2_270c, MAX_HEIGHT_3C(GxEPD2_270c)> display(GxEPD2_270c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW027C44 176x264, IL91874
  309. //GxEPD2_3C<GxEPD2_290c, MAX_HEIGHT_3C(GxEPD2_290c)> display(GxEPD2_290c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW029Z10 128x296, UC8151 (IL0373)
  310. //GxEPD2_3C<GxEPD2_290_Z13c, MAX_HEIGHT_3C(GxEPD2_290_Z13c)> display(GxEPD2_290_Z13c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEH029Z13 128x296, UC8151D
  311. //GxEPD2_3C<GxEPD2_290_C90c, MAX_HEIGHT_3C(GxEPD2_290_C90c)> display(GxEPD2_290_C90c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEM029C90 128x296, SSD1680
  312. ////GxEPD2_3C<GxEPD2_420c, MAX_HEIGHT_3C(GxEPD2_420c)> display(GxEPD2_420c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW042Z15 400x300, UC8176 (IL0398)
  313. ////GxEPD2_3C<GxEPD2_420c_Z21, MAX_HEIGHT_3C(GxEPD2_420c_Z21)> display(GxEPD2_420c_Z21(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEQ042Z21 400x300, UC8276
  314. ////GxEPD2_3C<GxEPD2_583c, MAX_HEIGHT_3C(GxEPD2_583c)> display(GxEPD2_583c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0583Z21 600x448, UC8179 (IL0371)
  315. ////GxEPD2_3C<GxEPD2_583c_Z83, MAX_HEIGHT_3C(GxEPD2_583c_Z83)> display(GxEPD2_583c_Z83(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW0583Z83 648x480, GD7965
  316. ////GxEPD2_3C<GxEPD2_750c, MAX_HEIGHT_3C(GxEPD2_750c)> display(GxEPD2_750c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW075Z09 640x384, UC8179 (IL0371)
  317. ////GxEPD2_3C<GxEPD2_750c_Z08, MAX_HEIGHT_3C(GxEPD2_750c_Z08)> display(GxEPD2_750c_Z08(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEW075Z08 800x480, GD7965
  318. ////GxEPD2_3C<GxEPD2_750c_Z90, MAX_HEIGHT_3C(GxEPD2_750c_Z90)> display(GxEPD2_750c_Z90(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEH075Z90 880x528, SSD1677
  319. // 4-color e-paper
  320. //GxEPD2_4C<GxEPD2_266c_GDEY0266F51H, MAX_HEIGHT_3C(GxEPD2_266c_GDEY0266F51H)> display(GxEPD2_266c_GDEY0266F51H(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY0266F51H 184x360, JD79667 (FPC-H006 22.04.02)
  321. //GxEPD2_4C<GxEPD2_290c_GDEY029F51H, MAX_HEIGHT_3C(GxEPD2_290c_GDEY029F51H)> display(GxEPD2_290c_GDEY029F51H(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY029F51H 168x384, JD79667 (FPC-H004 22.03.24)
  322. //GxEPD2_4C<GxEPD2_290c_GDEY029F51, MAX_HEIGHT_3C(GxEPD2_290c_GDEY029F51)> display(GxEPD2_290c_GDEY029F51(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY029F51 128x296, JD79667 (BWRY)
  323. //GxEPD2_4C<GxEPD2_300c, MAX_HEIGHT_3C(GxEPD2_300c)> display(GxEPD2_300c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // Waveshare 3.00" 4-color
  324. ////GxEPD2_4C<GxEPD2_420c_GDEY0420F51, MAX_HEIGHT_3C(GxEPD2_420c_GDEY0420F51)> display(GxEPD2_420c_GDEY0420F51(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY0420F51 400x300, HX8717 (no inking)
  325. ////GxEPD2_4C <GxEPD2_437c, MAX_HEIGHT_3C(GxEPD2_437c)> display(GxEPD2_437c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // Waveshare 4.37" 4-color
  326. // 7-color e-paper
  327. ////#define MAX_HEIGHT_7C(EPD) (EPD::HEIGHT <= (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2) ? EPD::HEIGHT : (MAX_DISPLAY_BUFFER_SIZE) / (EPD::WIDTH / 2)) // 2 pixel per byte
  328. ////GxEPD2_7C<GxEPD2_565c, MAX_HEIGHT_7C(GxEPD2_565c)> display(GxEPD2_565c(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // Waveshare 5.65" 7-color
  329. ////GxEPD2_7C<GxEPD2_730c_GDEY073D46, MAX_HEIGHT_7C(GxEPD2_730c_GDEY073D46)> display(GxEPD2_730c_GDEY073D46(/*CS=PA4*/ SS, /*DC=*/ PA3, /*RST=*/ PA2, /*BUSY=*/ PA1)); // GDEY073D46 800x480 7-color, (N-FPC-001 2021.11.26)
  330. #undef MAX_DISPLAY_BUFFER_SIZE
  331. #undef MAX_HEIGHT
  332. #undef MAX_HEIGHT_3C
  333. #undef MAX_HEIGHT_7C
  334. #endif
  335. #if !defined(__AVR) && !defined(STM32F1xx)
  336. // comment out unused bitmaps to reduce code space used
  337. #include "bitmaps/Bitmaps200x200.h" // 1.54" b/w
  338. #include "bitmaps/Bitmaps104x212.h" // 2.13" b/w flexible GDEW0213I5F
  339. #include "bitmaps/Bitmaps128x250.h" // 2.13" b/w
  340. #include "bitmaps/Bitmaps128x296.h" // 2.9" b/w
  341. #include "bitmaps/Bitmaps176x264.h" // 2.7" b/w
  342. #include "bitmaps/Bitmaps400x300.h" // 4.2" b/w
  343. #include "bitmaps/Bitmaps640x384.h" // 7.5" b/w
  344. // 3-color
  345. #include "bitmaps/Bitmaps3c200x200.h" // 1.54" b/w/r
  346. #include "bitmaps/Bitmaps3c104x212.h" // 2.13" b/w/r
  347. #include "bitmaps/Bitmaps3c128x296.h" // 2.9" b/w/r
  348. #include "bitmaps/Bitmaps3c176x264.h" // 2.7" b/w/r
  349. #include "bitmaps/Bitmaps3c400x300.h" // 4.2" b/w/r
  350. #if defined(ESP8266) || defined(ESP32)
  351. #include "bitmaps/WS_Bitmaps800x600.h" // 6.0" grey
  352. #endif
  353. #else
  354. // select only one to fit in code space
  355. #include "bitmaps/Bitmaps200x200.h" // 1.54" b/w
  356. //#include "bitmaps/Bitmaps104x212.h" // 2.13" b/w flexible GDEW0213I5F
  357. //#include "bitmaps/Bitmaps128x250.h" // 2.13" b/w
  358. //#include "bitmaps/Bitmaps128x296.h" // 2.9" b/w
  359. //#include "bitmaps/Bitmaps176x264.h" // 2.7" b/w
  360. ////#include "bitmaps/Bitmaps400x300.h" // 4.2" b/w // not enough code space
  361. ////#include "bitmaps/Bitmaps640x384.h" // 7.5" b/w // not enough code space
  362. // 3-color
  363. //#include "bitmaps/Bitmaps3c200x200.h" // 1.54" b/w/r
  364. //#include "bitmaps/Bitmaps3c104x212.h" // 2.13" b/w/r
  365. //#include "bitmaps/Bitmaps3c128x296.h" // 2.9" b/w/r
  366. //#include "bitmaps/Bitmaps3c176x264.h" // 2.7" b/w/r
  367. ////#include "bitmaps/Bitmaps3c400x300.h" // 4.2" b/w/r // not enough code space
  368. #endif
  369. // for handling alternative SPI pins (ESP32, RP2040) see example GxEPD2_Example.ino
  370. void setup()
  371. {
  372. Serial.begin(115200);
  373. Serial.println();
  374. Serial.println("setup");
  375. delay(100);
  376. //display.init(115200); // default 10ms reset pulse, e.g. for bare panels with DESPI-C02
  377. display.init(115200, true, 2, false); // USE THIS for Waveshare boards with "clever" reset circuit, 2ms reset pulse
  378. if (display.pages() > 1)
  379. {
  380. delay(100);
  381. Serial.print("pages = "); Serial.print(display.pages()); Serial.print(" page height = "); Serial.println(display.pageHeight());
  382. delay(1000);
  383. showPages();
  384. display.hibernate();
  385. return;
  386. }
  387. // first update should be full refresh
  388. helloWorld();
  389. delay(1000);
  390. // partial refresh mode can be used to full screen,
  391. // effective if display panel hasFastPartialUpdate
  392. helloFullScreenPartialMode();
  393. delay(1000);
  394. helloArduino();
  395. delay(1000);
  396. helloEpaper();
  397. delay(1000);
  398. //helloValue(123.9, 1);
  399. //delay(1000);
  400. showFont("FreeMonoBold9pt7b", &FreeMonoBold9pt7b);
  401. delay(1000);
  402. drawBitmaps();
  403. if (display.epd2.hasPartialUpdate)
  404. {
  405. showPartialUpdate();
  406. delay(1000);
  407. } // else // on GDEW0154Z04 only full update available, doesn't look nice
  408. //drawCornerTest();
  409. //showBox(16, 16, 48, 32, false);
  410. //showBox(16, 56, 48, 32, true);
  411. display.powerOff();
  412. deepSleepTest();
  413. Serial.println("setup done");
  414. }
  415. void loop()
  416. {
  417. }
  418. void showPages()
  419. {
  420. display.setRotation(0);
  421. display.setFont(&FreeMonoBold9pt7b);
  422. display.setTextColor(GxEPD_BLACK);
  423. display.clearScreen(0); // black
  424. display.setFullWindow();
  425. display.fillScreen(GxEPD_WHITE);
  426. display.setCursor(0, 10);
  427. if (display.width() >= 300)
  428. {
  429. display.print("would need "); display.print(display.pages()); display.println(" pages of height "); display.print(display.pageHeight());
  430. }
  431. else
  432. {
  433. display.println("would need");
  434. display.print(display.pages()); display.println(" pages of");
  435. display.print("height "); display.print(display.pageHeight());
  436. }
  437. display.display(false); // full update
  438. }
  439. // note for partial update window and setPartialWindow() method:
  440. // partial update window size and position is on byte boundary in physical x direction
  441. // the size is increased in setPartialWindow() if x or w are not multiple of 8 for even rotation, y or h for odd rotation
  442. // see also comment in GxEPD2_BW.h, GxEPD2_3C.h or GxEPD2_GFX.h for method setPartialWindow()
  443. const char HelloWorld[] = "Hello World!";
  444. const char HelloArduino[] = "Hello Arduino!";
  445. const char HelloEpaper[] = "Hello E-Paper!";
  446. void helloWorld()
  447. {
  448. //Serial.println("helloWorld");
  449. display.setRotation(1);
  450. display.setFont(&FreeMonoBold9pt7b);
  451. display.setTextColor(GxEPD_BLACK);
  452. int16_t tbx, tby; uint16_t tbw, tbh;
  453. display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  454. // center bounding box by transposition of origin:
  455. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  456. uint16_t y = ((display.height() - tbh) / 2) - tby;
  457. // full window mode is the initial mode, set it anyway
  458. display.setFullWindow();
  459. display.fillScreen(GxEPD_WHITE);
  460. display.setCursor(x, y);
  461. display.print(HelloWorld);
  462. display.display(false); // full update
  463. //Serial.println("helloWorld done");
  464. }
  465. void helloWorldForDummiesNotPaged()
  466. {
  467. //Serial.println("helloWorld");
  468. const char text[] = "Hello World!";
  469. // most e-papers have width < height (portrait) as native orientation, especially the small ones
  470. // in GxEPD2 rotation 0 is used for native orientation (most TFT libraries use 0 fix for portrait orientation)
  471. // set rotation to 1 (rotate right 90 degrees) to have enough space on small displays (landscape)
  472. display.setRotation(1);
  473. // select a suitable font in Adafruit_GFX
  474. display.setFont(&FreeMonoBold9pt7b);
  475. // on e-papers black on white is more pleasant to read
  476. display.setTextColor(GxEPD_BLACK);
  477. // Adafruit_GFX has a handy method getTextBounds() to determine the boundary box for a text for the actual font
  478. int16_t tbx, tby; uint16_t tbw, tbh; // boundary box window
  479. display.getTextBounds(text, 0, 0, &tbx, &tby, &tbw, &tbh); // it works for origin 0, 0, fortunately (negative tby!)
  480. // center bounding box by transposition of origin:
  481. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  482. uint16_t y = ((display.height() - tbh) / 2) - tby;
  483. // full window mode is the initial mode, set it anyway
  484. display.setFullWindow();
  485. // here we use full buffered drawing
  486. // only part of the display is used if page_height is less than HEIGHT
  487. display.fillScreen(GxEPD_WHITE); // set the background to white (fill the buffer with value for white)
  488. display.setCursor(x, y); // set the postition to start printing text
  489. display.print(text); // print some text
  490. // tell the graphics class to transfer the buffer content (page) to the controller buffer
  491. // and to refresh to the screen
  492. display.display(false); // full update
  493. //Serial.println("helloWorld done");
  494. }
  495. void helloFullScreenPartialMode()
  496. {
  497. //Serial.println("helloFullScreenPartialMode");
  498. const char fullscreen[] = "full screen update";
  499. const char fpm[] = "fast partial mode";
  500. const char spm[] = "slow partial mode";
  501. const char npm[] = "no partial mode";
  502. // full window mode is the initial mode, set it anyway
  503. display.setFullWindow();
  504. display.setRotation(1);
  505. display.setFont(&FreeMonoBold9pt7b);
  506. display.setTextColor(GxEPD_BLACK);
  507. const char* updatemode;
  508. if (display.epd2.hasFastPartialUpdate)
  509. {
  510. updatemode = fpm;
  511. }
  512. else if (display.epd2.hasPartialUpdate)
  513. {
  514. updatemode = spm;
  515. }
  516. else
  517. {
  518. updatemode = npm;
  519. }
  520. // do this outside of the loop
  521. int16_t tbx, tby; uint16_t tbw, tbh;
  522. // center update text
  523. display.getTextBounds(fullscreen, 0, 0, &tbx, &tby, &tbw, &tbh);
  524. uint16_t utx = ((display.width() - tbw) / 2) - tbx;
  525. uint16_t uty = ((display.height() / 4) - tbh / 2) - tby;
  526. // center update mode
  527. display.getTextBounds(updatemode, 0, 0, &tbx, &tby, &tbw, &tbh);
  528. uint16_t umx = ((display.width() - tbw) / 2) - tbx;
  529. uint16_t umy = ((display.height() * 3 / 4) - tbh / 2) - tby;
  530. // center HelloWorld
  531. display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  532. uint16_t hwx = ((display.width() - tbw) / 2) - tbx;
  533. uint16_t hwy = ((display.height() - tbh) / 2) - tby;
  534. display.fillScreen(GxEPD_WHITE);
  535. display.setCursor(hwx, hwy);
  536. display.print(HelloWorld);
  537. display.setCursor(utx, uty);
  538. display.print(fullscreen);
  539. display.setCursor(umx, umy);
  540. display.print(updatemode);
  541. display.display(true); // partial update
  542. //Serial.println("helloFullScreenPartialMode done");
  543. }
  544. void helloArduino()
  545. {
  546. //Serial.println("helloArduino");
  547. display.setRotation(1);
  548. display.setFont(&FreeMonoBold9pt7b);
  549. display.setTextColor(display.epd2.hasColor ? GxEPD_RED : GxEPD_BLACK);
  550. int16_t tbx, tby; uint16_t tbw, tbh;
  551. // align with centered HelloWorld
  552. display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  553. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  554. // height might be different
  555. display.getTextBounds(HelloArduino, 0, 0, &tbx, &tby, &tbw, &tbh);
  556. uint16_t y = ((display.height() / 4) - tbh / 2) - tby; // y is base line!
  557. // make the window big enough to cover (overwrite) descenders of previous text
  558. uint16_t wh = FreeMonoBold9pt7b.yAdvance;
  559. uint16_t wy = (display.height() / 4) - wh / 2;
  560. // full window mode is the initial mode, set it anyway
  561. display.setFullWindow();
  562. // DO NOT display.fillScreen(GxEPD_WHITE); keep current content!
  563. display.fillRect(0, wy, display.width(), wh, GxEPD_WHITE); // clear rect instead
  564. display.setCursor(x, y);
  565. display.print(HelloArduino);
  566. display.displayWindow(0, wy, display.width(), wh);
  567. delay(1000);
  568. //Serial.println("helloArduino done");
  569. }
  570. void helloEpaper()
  571. {
  572. //Serial.println("helloEpaper");
  573. display.setRotation(1);
  574. display.setFont(&FreeMonoBold9pt7b);
  575. display.setTextColor(display.epd2.hasColor ? GxEPD_RED : GxEPD_BLACK);
  576. int16_t tbx, tby; uint16_t tbw, tbh;
  577. // align with centered HelloWorld
  578. display.getTextBounds(HelloWorld, 0, 0, &tbx, &tby, &tbw, &tbh);
  579. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  580. // height might be different
  581. display.getTextBounds(HelloEpaper, 0, 0, &tbx, &tby, &tbw, &tbh);
  582. uint16_t y = (display.height() * 3 / 4) + tbh / 2; // y is base line!
  583. // make the window big enough to cover (overwrite) descenders of previous text
  584. uint16_t wh = FreeMonoBold9pt7b.yAdvance;
  585. uint16_t wy = (display.height() * 3 / 4) - wh / 2;
  586. // full window mode is the initial mode, set it anyway
  587. display.setFullWindow();
  588. // DO NOT display.fillScreen(GxEPD_WHITE); keep current content!
  589. display.fillRect(0, wy, display.width(), wh, GxEPD_WHITE); // clear rect instead
  590. display.setCursor(x, y);
  591. display.print(HelloEpaper);
  592. display.displayWindow(0, wy, display.width(), wh);
  593. //Serial.println("helloEpaper done");
  594. }
  595. #if defined(ESP8266) || defined(ESP32)
  596. #include <StreamString.h>
  597. #define PrintString StreamString
  598. #else
  599. class PrintString : public Print, public String
  600. {
  601. public:
  602. size_t write(uint8_t data) override
  603. {
  604. return concat(char(data));
  605. };
  606. };
  607. #endif
  608. void helloValue(double v, int digits)
  609. {
  610. //Serial.println("helloValue");
  611. display.setRotation(1);
  612. display.setFont(&FreeMonoBold9pt7b);
  613. display.setTextColor(display.epd2.hasColor ? GxEPD_RED : GxEPD_BLACK);
  614. PrintString valueString;
  615. valueString.print(v, digits);
  616. int16_t tbx, tby; uint16_t tbw, tbh;
  617. display.getTextBounds(valueString, 0, 0, &tbx, &tby, &tbw, &tbh);
  618. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  619. uint16_t y = (display.height() * 3 / 4) + tbh / 2; // y is base line!
  620. // show what happens, if we use the bounding box for partial window
  621. uint16_t wx = (display.width() - tbw) / 2;
  622. uint16_t wy = (display.height() * 3 / 4) - tbh / 2;
  623. // full window mode is the initial mode, set it anyway
  624. display.setFullWindow();
  625. // DO NOT display.fillScreen(GxEPD_WHITE); keep current content!
  626. display.fillRect(wx, wy, tbw, tbh, GxEPD_WHITE); // clear rect instead
  627. display.setCursor(x, y);
  628. display.print(valueString);
  629. display.displayWindow(wx, wy, tbw, tbh);
  630. delay(2000);
  631. // make the partial window big enough to cover the previous text
  632. uint16_t ww = tbw; // remember window width
  633. display.getTextBounds(HelloEpaper, 0, 0, &tbx, &tby, &tbw, &tbh);
  634. // adjust, because HelloEpaper was aligned, not centered (could calculate this to be precise)
  635. ww = max(ww, uint16_t(tbw + 12)); // 12 seems ok
  636. wx = (display.width() - tbw) / 2;
  637. // make the window big enough to cover (overwrite) descenders of previous text
  638. uint16_t wh = FreeMonoBold9pt7b.yAdvance;
  639. wy = (display.height() * 3 / 4) - wh / 2;
  640. // DO NOT display.fillScreen(GxEPD_WHITE); keep current content!
  641. display.fillRect(wx, wy, ww, wh, GxEPD_WHITE); // clear rect instead
  642. display.setCursor(x, y);
  643. display.print(valueString);
  644. display.displayWindow(wx, wy, ww, wh);
  645. // alternately use the whole width for partial window
  646. //display.displayWindow(wx, wy, display.width(), wh);
  647. //Serial.println("helloValue done");
  648. }
  649. void deepSleepTest()
  650. {
  651. //Serial.println("deepSleepTest");
  652. const char hibernating[] = "hibernating ...";
  653. const char wokeup[] = "woke up";
  654. const char from[] = "from deep sleep";
  655. const char again[] = "again";
  656. display.setRotation(1);
  657. display.setFont(&FreeMonoBold9pt7b);
  658. display.setTextColor(GxEPD_BLACK);
  659. int16_t tbx, tby; uint16_t tbw, tbh;
  660. // center text
  661. display.getTextBounds(hibernating, 0, 0, &tbx, &tby, &tbw, &tbh);
  662. uint16_t x = ((display.width() - tbw) / 2) - tbx;
  663. uint16_t y = ((display.height() - tbh) / 2) - tby;
  664. display.setFullWindow();
  665. display.fillScreen(GxEPD_WHITE);
  666. display.setCursor(x, y);
  667. display.print(hibernating);
  668. display.display(false); // full update
  669. display.hibernate();
  670. delay(5000);
  671. display.getTextBounds(wokeup, 0, 0, &tbx, &tby, &tbw, &tbh);
  672. uint16_t wx = (display.width() - tbw) / 2;
  673. uint16_t wy = (display.height() / 3) + tbh / 2; // y is base line!
  674. display.getTextBounds(from, 0, 0, &tbx, &tby, &tbw, &tbh);
  675. uint16_t fx = (display.width() - tbw) / 2;
  676. uint16_t fy = (display.height() * 2 / 3) + tbh / 2; // y is base line!
  677. display.fillScreen(GxEPD_WHITE);
  678. display.setCursor(wx, wy);
  679. display.print(wokeup);
  680. display.setCursor(fx, fy);
  681. display.print(from);
  682. display.display(false); // full update
  683. delay(5000);
  684. display.getTextBounds(hibernating, 0, 0, &tbx, &tby, &tbw, &tbh);
  685. uint16_t hx = (display.width() - tbw) / 2;
  686. uint16_t hy = (display.height() / 3) + tbh / 2; // y is base line!
  687. display.getTextBounds(again, 0, 0, &tbx, &tby, &tbw, &tbh);
  688. uint16_t ax = (display.width() - tbw) / 2;
  689. uint16_t ay = (display.height() * 2 / 3) + tbh / 2; // y is base line!
  690. display.fillScreen(GxEPD_WHITE);
  691. display.setCursor(hx, hy);
  692. display.print(hibernating);
  693. display.setCursor(ax, ay);
  694. display.print(again);
  695. display.display(false); // full update
  696. display.hibernate();
  697. //Serial.println("deepSleepTest done");
  698. }
  699. void showBox(uint16_t x, uint16_t y, uint16_t w, uint16_t h, bool partial)
  700. {
  701. //Serial.println("showBox");
  702. display.setRotation(1);
  703. display.setFullWindow();
  704. display.fillScreen(GxEPD_WHITE);
  705. display.fillRect(x, y, w, h, GxEPD_BLACK);
  706. if (partial)
  707. {
  708. display.displayWindow(x, y, w, h);
  709. }
  710. else
  711. {
  712. display.display(false); // full update
  713. }
  714. //Serial.println("showBox done");
  715. }
  716. void drawCornerTest()
  717. {
  718. display.setFullWindow();
  719. display.setFont(&FreeMonoBold9pt7b);
  720. display.setTextColor(GxEPD_BLACK);
  721. for (uint16_t r = 0; r <= 4; r++)
  722. {
  723. display.setRotation(r);
  724. display.fillScreen(GxEPD_WHITE);
  725. display.fillRect(0, 0, 8, 8, GxEPD_BLACK);
  726. display.fillRect(display.width() - 18, 0, 16, 16, GxEPD_BLACK);
  727. display.fillRect(display.width() - 25, display.height() - 25, 24, 24, GxEPD_BLACK);
  728. display.fillRect(0, display.height() - 33, 32, 32, GxEPD_BLACK);
  729. display.setCursor(display.width() / 2, display.height() / 2);
  730. display.print(display.getRotation());
  731. display.display(false); // full update
  732. delay(2000);
  733. }
  734. }
  735. void showFont(const char name[], const GFXfont* f)
  736. {
  737. display.setFullWindow();
  738. display.setRotation(0);
  739. display.setTextColor(GxEPD_BLACK);
  740. drawFont(name, f);
  741. display.display(false); // full update
  742. }
  743. void drawFont(const char name[], const GFXfont* f)
  744. {
  745. //display.setRotation(0);
  746. display.fillScreen(GxEPD_WHITE);
  747. display.setTextColor(GxEPD_BLACK);
  748. display.setFont(f);
  749. display.setCursor(0, 0);
  750. display.println();
  751. display.println(name);
  752. display.println(" !\"#$%&'()*+,-./");
  753. display.println("0123456789:;<=>?");
  754. display.println("@ABCDEFGHIJKLMNO");
  755. display.println("PQRSTUVWXYZ[\\]^_");
  756. if (display.epd2.hasColor)
  757. {
  758. display.setTextColor(GxEPD_RED);
  759. }
  760. display.println("`abcdefghijklmno");
  761. display.println("pqrstuvwxyz{|}~ ");
  762. }
  763. // note for partial update window and setPartialWindow() method:
  764. // partial update window size and position is on byte boundary in physical x direction
  765. // the size is increased in setPartialWindow() if x or w are not multiple of 8 for even rotation, y or h for odd rotation
  766. // see also comment in GxEPD2_BW.h, GxEPD2_3C.h or GxEPD2_GFX.h for method setPartialWindow()
  767. // showPartialUpdate() purposely uses values that are not multiples of 8 to test this
  768. void showPartialUpdate()
  769. {
  770. // some useful background
  771. helloWorld();
  772. // use asymmetric values for test
  773. uint16_t box_x = 10;
  774. uint16_t box_y = 15;
  775. uint16_t box_w = 70;
  776. uint16_t box_h = 20;
  777. uint16_t cursor_y = box_y + box_h - 6;
  778. float value = 13.95;
  779. uint16_t incr = display.epd2.hasFastPartialUpdate ? 1 : 3;
  780. display.setFont(&FreeMonoBold9pt7b);
  781. display.setTextColor(GxEPD_BLACK);
  782. display.setFullWindow();
  783. // show where the update box is
  784. for (uint16_t r = 0; r < 4; r++)
  785. {
  786. display.setRotation(r);
  787. display.fillRect(box_x, box_y, box_w, box_h, GxEPD_BLACK);
  788. //display.fillScreen(GxEPD_BLACK);
  789. display.displayWindow(box_x, box_y, box_w, box_h);
  790. delay(2000);
  791. display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
  792. display.displayWindow(box_x, box_y, box_w, box_h);
  793. delay(1000);
  794. }
  795. //return;
  796. // show updates in the update box
  797. for (uint16_t r = 0; r < 4; r++)
  798. {
  799. display.setRotation(r);
  800. for (uint16_t i = 1; i <= 10; i += incr)
  801. {
  802. display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
  803. display.setCursor(box_x, cursor_y);
  804. display.print(value * i, 2);
  805. display.displayWindow(box_x, box_y, box_w, box_h);
  806. delay(500);
  807. }
  808. delay(1000);
  809. display.fillRect(box_x, box_y, box_w, box_h, GxEPD_WHITE);
  810. display.displayWindow(box_x, box_y, box_w, box_h);
  811. delay(1000);
  812. }
  813. }
  814. void drawBitmaps()
  815. {
  816. display.setFullWindow();
  817. #ifdef _GxBitmaps104x212_H_
  818. drawBitmaps104x212();
  819. #endif
  820. #ifdef _GxBitmaps128x250_H_
  821. drawBitmaps128x250();
  822. #endif
  823. #ifdef _GxBitmaps128x296_H_
  824. drawBitmaps128x296();
  825. #endif
  826. #ifdef _GxBitmaps176x264_H_
  827. drawBitmaps176x264();
  828. #endif
  829. #ifdef _GxBitmaps400x300_H_
  830. drawBitmaps400x300();
  831. #endif
  832. #ifdef _GxBitmaps640x384_H_
  833. drawBitmaps640x384();
  834. #endif
  835. #ifdef _WS_Bitmaps800x600_H_
  836. drawBitmaps800x600();
  837. #endif
  838. // 3-color
  839. #ifdef _GxBitmaps3c104x212_H_
  840. drawBitmaps3c104x212();
  841. #endif
  842. #ifdef _GxBitmaps3c128x296_H_
  843. drawBitmaps3c128x296();
  844. #endif
  845. #ifdef _GxBitmaps3c176x264_H_
  846. drawBitmaps3c176x264();
  847. #endif
  848. #ifdef _GxBitmaps3c400x300_H_
  849. drawBitmaps3c400x300();
  850. #endif
  851. // show these after the specific bitmaps
  852. #ifdef _GxBitmaps200x200_H_
  853. drawBitmaps200x200();
  854. #endif
  855. // 3-color
  856. #ifdef _GxBitmaps3c200x200_H_
  857. drawBitmaps3c200x200();
  858. #endif
  859. }
  860. #ifdef _GxBitmaps200x200_H_
  861. void drawBitmaps200x200()
  862. {
  863. #if defined(__AVR)
  864. const unsigned char* bitmaps[] =
  865. {
  866. logo200x200, first200x200 //, second200x200, third200x200, fourth200x200, fifth200x200, sixth200x200, senventh200x200, eighth200x200
  867. };
  868. #elif defined(_BOARD_GENERIC_STM32F103C_H_)
  869. const unsigned char* bitmaps[] =
  870. {
  871. logo200x200, first200x200, second200x200, third200x200, fourth200x200, fifth200x200 //, sixth200x200, senventh200x200, eighth200x200
  872. };
  873. #else
  874. const unsigned char* bitmaps[] =
  875. {
  876. logo200x200, first200x200, second200x200, third200x200, fourth200x200, fifth200x200, sixth200x200, senventh200x200, eighth200x200
  877. };
  878. #endif
  879. if ((display.epd2.panel == GxEPD2::GDEP015OC1) || (display.epd2.panel == GxEPD2::GDEH0154D67))
  880. {
  881. bool m = display.mirror(true);
  882. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  883. {
  884. display.fillScreen(GxEPD_WHITE);
  885. display.drawInvertedBitmap(0, 0, bitmaps[i], display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  886. display.display();
  887. delay(2000);
  888. }
  889. display.mirror(m);
  890. }
  891. //else
  892. {
  893. bool mirror_y = (display.epd2.panel != GxEPD2::GDE0213B1);
  894. display.clearScreen(); // use default for white
  895. int16_t x = (int16_t(display.epd2.WIDTH) - 200) / 2;
  896. int16_t y = (int16_t(display.epd2.HEIGHT) - 200) / 2;
  897. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  898. {
  899. display.drawImage(bitmaps[i], x, y, 200, 200, false, mirror_y, true);
  900. delay(2000);
  901. }
  902. }
  903. bool mirror_y = (display.epd2.panel != GxEPD2::GDE0213B1);
  904. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  905. {
  906. int16_t x = -60;
  907. int16_t y = -60;
  908. for (uint16_t j = 0; j < 10; j++)
  909. {
  910. display.writeScreenBuffer(); // use default for white
  911. display.writeImage(bitmaps[i], x, y, 200, 200, false, mirror_y, true);
  912. display.refresh(true);
  913. if (display.epd2.hasFastPartialUpdate)
  914. {
  915. // for differential update: set previous buffer equal to current buffer in controller
  916. display.epd2.writeScreenBufferAgain(); // use default for white
  917. display.epd2.writeImageAgain(bitmaps[i], x, y, 200, 200, false, mirror_y, true);
  918. }
  919. delay(2000);
  920. x += 40;
  921. y += 40;
  922. if ((x >= int16_t(display.epd2.WIDTH)) || (y >= int16_t(display.epd2.HEIGHT))) break;
  923. }
  924. if (!display.epd2.hasFastPartialUpdate) break; // comment out for full show
  925. break; // comment out for full show
  926. }
  927. display.writeScreenBuffer(); // use default for white
  928. display.writeImage(bitmaps[0], int16_t(0), 0, 200, 200, false, mirror_y, true);
  929. display.writeImage(bitmaps[0], int16_t(int16_t(display.epd2.WIDTH) - 200), int16_t(display.epd2.HEIGHT) - 200, 200, 200, false, mirror_y, true);
  930. display.refresh(true);
  931. delay(2000);
  932. }
  933. #endif
  934. #ifdef _GxBitmaps104x212_H_
  935. void drawBitmaps104x212()
  936. {
  937. #if !defined(__AVR)
  938. const unsigned char* bitmaps[] =
  939. {
  940. WS_Bitmap104x212, Bitmap104x212_1, Bitmap104x212_2, Bitmap104x212_3
  941. };
  942. #else
  943. const unsigned char* bitmaps[] =
  944. {
  945. WS_Bitmap104x212, Bitmap104x212_1, Bitmap104x212_2, Bitmap104x212_3
  946. };
  947. #endif
  948. if (display.epd2.panel == GxEPD2::GDEW0213I5F)
  949. {
  950. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  951. {
  952. display.fillScreen(GxEPD_WHITE);
  953. display.drawBitmap(0, 0, bitmaps[i], display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  954. display.display();
  955. delay(2000);
  956. }
  957. }
  958. }
  959. #endif
  960. #ifdef _GxBitmaps128x250_H_
  961. void drawBitmaps128x250()
  962. {
  963. #if !defined(__AVR)
  964. const unsigned char* bitmaps[] =
  965. {
  966. Bitmap128x250_1, logo128x250, first128x250, second128x250, third128x250
  967. };
  968. #else
  969. const unsigned char* bitmaps[] =
  970. {
  971. Bitmap128x250_1, logo128x250, first128x250, second128x250, third128x250
  972. };
  973. #endif
  974. if ((display.epd2.panel == GxEPD2::GDE0213B1) || (display.epd2.panel == GxEPD2::GDEH0213B72))
  975. {
  976. bool m = display.mirror(true);
  977. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  978. {
  979. display.fillScreen(GxEPD_WHITE);
  980. display.drawInvertedBitmap(0, 0, bitmaps[i], display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  981. display.display();
  982. delay(2000);
  983. }
  984. display.mirror(m);
  985. }
  986. }
  987. #endif
  988. #ifdef _GxBitmaps128x296_H_
  989. void drawBitmaps128x296()
  990. {
  991. #if !defined(__AVR)
  992. const unsigned char* bitmaps[] =
  993. {
  994. Bitmap128x296_1, logo128x296, first128x296, second128x296, third128x296
  995. };
  996. #else
  997. const unsigned char* bitmaps[] =
  998. {
  999. Bitmap128x296_1, logo128x296 //, first128x296, second128x296, third128x296
  1000. };
  1001. #endif
  1002. if (display.epd2.panel == GxEPD2::GDEH029A1)
  1003. {
  1004. bool m = display.mirror(true);
  1005. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1006. {
  1007. display.fillScreen(GxEPD_WHITE);
  1008. display.drawInvertedBitmap(0, 0, bitmaps[i], display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1009. display.display();
  1010. delay(2000);
  1011. }
  1012. display.mirror(m);
  1013. }
  1014. }
  1015. #endif
  1016. #ifdef _GxBitmaps176x264_H_
  1017. void drawBitmaps176x264()
  1018. {
  1019. #if !defined(__AVR)
  1020. const unsigned char* bitmaps[] =
  1021. {
  1022. Bitmap176x264_1, Bitmap176x264_2, Bitmap176x264_3, Bitmap176x264_4, Bitmap176x264_5
  1023. };
  1024. #else
  1025. const unsigned char* bitmaps[] =
  1026. {
  1027. Bitmap176x264_1, Bitmap176x264_2 //, Bitmap176x264_3, Bitmap176x264_4, Bitmap176x264_5
  1028. };
  1029. #endif
  1030. if (display.epd2.panel == GxEPD2::GDEW027W3)
  1031. {
  1032. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1033. {
  1034. display.fillScreen(GxEPD_WHITE);
  1035. display.drawInvertedBitmap(0, 0, bitmaps[i], display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1036. display.display();
  1037. delay(2000);
  1038. }
  1039. }
  1040. }
  1041. #endif
  1042. #ifdef _GxBitmaps400x300_H_
  1043. void drawBitmaps400x300()
  1044. {
  1045. #if !defined(__AVR)
  1046. const unsigned char* bitmaps[] =
  1047. {
  1048. Bitmap400x300_1, Bitmap400x300_2
  1049. };
  1050. #else
  1051. const unsigned char* bitmaps[] = {}; // not enough code space
  1052. #endif
  1053. if (display.epd2.panel == GxEPD2::GDEW042T2)
  1054. {
  1055. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1056. {
  1057. display.fillScreen(GxEPD_WHITE);
  1058. display.drawInvertedBitmap(0, 0, bitmaps[i], display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1059. display.display();
  1060. delay(2000);
  1061. }
  1062. }
  1063. }
  1064. #endif
  1065. #ifdef _GxBitmaps640x384_H_
  1066. void drawBitmaps640x384()
  1067. {
  1068. #if !defined(__AVR)
  1069. const unsigned char* bitmaps[] =
  1070. {
  1071. Bitmap640x384_1, Bitmap640x384_2
  1072. };
  1073. #else
  1074. const unsigned char* bitmaps[] = {}; // not enough code space
  1075. #endif
  1076. if ((display.epd2.panel == GxEPD2::GDEW075T8) || (display.epd2.panel == GxEPD2::GDEW075Z09))
  1077. {
  1078. for (uint16_t i = 0; i < sizeof(bitmaps) / sizeof(char*); i++)
  1079. {
  1080. display.fillScreen(GxEPD_WHITE);
  1081. display.drawInvertedBitmap(0, 0, bitmaps[i], display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1082. display.display();
  1083. delay(2000);
  1084. }
  1085. }
  1086. }
  1087. #endif
  1088. #ifdef _WS_Bitmaps800x600_H_
  1089. void drawBitmaps800x600()
  1090. {
  1091. #if defined(ESP8266) || defined(ESP32)
  1092. if (display.epd2.panel == GxEPD2::ED060SCT)
  1093. {
  1094. // Serial.print("sizeof(WS_zoo_800x600) is "); Serial.println(sizeof(WS_zoo_800x600));
  1095. display.drawNative(WS_zoo_800x600, 0, 0, 0, 800, 600, false, false, true);
  1096. delay(2000);
  1097. // Serial.print("sizeof(WS_pic_1200x825) is "); Serial.println(sizeof(WS_pic_1200x825));
  1098. // display.drawNative((const uint8_t*)WS_pic_1200x825, 0, 0, 0, 1200, 825, false, false, true);
  1099. // delay(2000);
  1100. // Serial.print("sizeof(WS_acaa_1024x731) is "); Serial.println(sizeof(WS_acaa_1024x731));
  1101. // display.drawNative(WS_acaa_1024x731, 0, 0, 0, 1024, 731, false, false, true);
  1102. // delay(2000);
  1103. }
  1104. #endif
  1105. }
  1106. #endif
  1107. struct bitmap_pair
  1108. {
  1109. const unsigned char* black;
  1110. const unsigned char* red;
  1111. };
  1112. #ifdef _GxBitmaps3c200x200_H_
  1113. void drawBitmaps3c200x200()
  1114. {
  1115. bitmap_pair bitmap_pairs[] =
  1116. {
  1117. //{Bitmap3c200x200_black, Bitmap3c200x200_red},
  1118. {WS_Bitmap3c200x200_black, WS_Bitmap3c200x200_red}
  1119. };
  1120. if (display.epd2.panel == GxEPD2::GDEW0154Z04)
  1121. {
  1122. display.fillScreen(GxEPD_WHITE);
  1123. // Bitmap3c200x200_black has 2 bits per pixel
  1124. // taken from Adafruit_GFX.cpp, modified
  1125. int16_t byteWidth = (display.epd2.WIDTH + 7) / 8; // Bitmap scanline pad = whole byte
  1126. uint8_t byte = 0;
  1127. for (int16_t j = 0; j < display.epd2.HEIGHT; j++)
  1128. {
  1129. for (int16_t i = 0; i < display.epd2.WIDTH; i++)
  1130. {
  1131. if (i & 3) byte <<= 2;
  1132. else
  1133. {
  1134. #if defined(__AVR) || defined(ESP8266) || defined(ESP32)
  1135. byte = pgm_read_byte(&Bitmap3c200x200_black[j * byteWidth * 2 + i / 4]);
  1136. #else
  1137. byte = Bitmap3c200x200_black[j * byteWidth * 2 + i / 4];
  1138. #endif
  1139. }
  1140. if (!(byte & 0x80))
  1141. {
  1142. display.drawPixel(i, j, GxEPD_BLACK);
  1143. }
  1144. }
  1145. }
  1146. display.drawInvertedBitmap(0, 0, Bitmap3c200x200_red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1147. display.display();
  1148. delay(2000);
  1149. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1150. {
  1151. display.fillScreen(GxEPD_WHITE);
  1152. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1153. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1154. display.display();
  1155. delay(2000);
  1156. }
  1157. }
  1158. if (display.epd2.hasColor)
  1159. {
  1160. display.clearScreen(); // use default for white
  1161. int16_t x = (int16_t(display.epd2.WIDTH) - 200) / 2;
  1162. int16_t y = (int16_t(display.epd2.HEIGHT) - 200) / 2;
  1163. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1164. {
  1165. display.drawImage(bitmap_pairs[i].black, bitmap_pairs[i].red, x, y, 200, 200, false, false, true);
  1166. delay(2000);
  1167. }
  1168. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1169. {
  1170. int16_t x = -60;
  1171. int16_t y = -60;
  1172. for (uint16_t j = 0; j < 10; j++)
  1173. {
  1174. display.writeScreenBuffer(); // use default for white
  1175. display.writeImage(bitmap_pairs[i].black, bitmap_pairs[i].red, x, y, 200, 200, false, false, true);
  1176. display.refresh();
  1177. delay(1000);
  1178. x += 40;
  1179. y += 40;
  1180. if ((x >= int16_t(display.epd2.WIDTH)) || (y >= int16_t(display.epd2.HEIGHT))) break;
  1181. }
  1182. }
  1183. display.writeScreenBuffer(); // use default for white
  1184. display.writeImage(bitmap_pairs[0].black, bitmap_pairs[0].red, 0, 0, 200, 200, false, false, true);
  1185. display.writeImage(bitmap_pairs[0].black, bitmap_pairs[0].red, int16_t(display.epd2.WIDTH) - 200, int16_t(display.epd2.HEIGHT) - 200, 200, 200, false, false, true);
  1186. display.refresh();
  1187. delay(2000);
  1188. }
  1189. }
  1190. #endif
  1191. #ifdef _GxBitmaps3c104x212_H_
  1192. void drawBitmaps3c104x212()
  1193. {
  1194. #if !defined(__AVR)
  1195. bitmap_pair bitmap_pairs[] =
  1196. {
  1197. {Bitmap3c104x212_1_black, Bitmap3c104x212_1_red},
  1198. {Bitmap3c104x212_2_black, Bitmap3c104x212_2_red},
  1199. {WS_Bitmap3c104x212_black, WS_Bitmap3c104x212_red}
  1200. };
  1201. #else
  1202. bitmap_pair bitmap_pairs[] =
  1203. {
  1204. {Bitmap3c104x212_1_black, Bitmap3c104x212_1_red},
  1205. //{Bitmap3c104x212_2_black, Bitmap3c104x212_2_red},
  1206. {WS_Bitmap3c104x212_black, WS_Bitmap3c104x212_red}
  1207. };
  1208. #endif
  1209. if (display.epd2.panel == GxEPD2::GDEW0213Z16)
  1210. {
  1211. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1212. {
  1213. display.fillScreen(GxEPD_WHITE);
  1214. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1215. if (bitmap_pairs[i].red == WS_Bitmap3c104x212_red)
  1216. {
  1217. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1218. }
  1219. else display.drawBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1220. display.display();
  1221. delay(2000);
  1222. }
  1223. }
  1224. }
  1225. #endif
  1226. #ifdef _GxBitmaps3c128x296_H_
  1227. void drawBitmaps3c128x296()
  1228. {
  1229. #if !defined(__AVR)
  1230. bitmap_pair bitmap_pairs[] =
  1231. {
  1232. {Bitmap3c128x296_1_black, Bitmap3c128x296_1_red},
  1233. {Bitmap3c128x296_2_black, Bitmap3c128x296_2_red},
  1234. {WS_Bitmap3c128x296_black, WS_Bitmap3c128x296_red}
  1235. };
  1236. #else
  1237. bitmap_pair bitmap_pairs[] =
  1238. {
  1239. //{Bitmap3c128x296_1_black, Bitmap3c128x296_1_red},
  1240. //{Bitmap3c128x296_2_black, Bitmap3c128x296_2_red},
  1241. {WS_Bitmap3c128x296_black, WS_Bitmap3c128x296_red}
  1242. };
  1243. #endif
  1244. if (display.epd2.panel == GxEPD2::GDEW029Z10)
  1245. {
  1246. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1247. {
  1248. display.fillScreen(GxEPD_WHITE);
  1249. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1250. if (bitmap_pairs[i].red == WS_Bitmap3c128x296_red)
  1251. {
  1252. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1253. }
  1254. else display.drawBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1255. display.display();
  1256. delay(2000);
  1257. }
  1258. }
  1259. }
  1260. #endif
  1261. #ifdef _GxBitmaps3c176x264_H_
  1262. void drawBitmaps3c176x264()
  1263. {
  1264. bitmap_pair bitmap_pairs[] =
  1265. {
  1266. {Bitmap3c176x264_black, Bitmap3c176x264_red}
  1267. };
  1268. if (display.epd2.panel == GxEPD2::GDEW027C44)
  1269. {
  1270. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1271. {
  1272. display.fillScreen(GxEPD_WHITE);
  1273. display.drawBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1274. display.drawBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1275. display.display();
  1276. delay(2000);
  1277. }
  1278. }
  1279. }
  1280. #endif
  1281. #ifdef _GxBitmaps3c400x300_H_
  1282. void drawBitmaps3c400x300()
  1283. {
  1284. #if !defined(__AVR)
  1285. bitmap_pair bitmap_pairs[] =
  1286. {
  1287. {Bitmap3c400x300_1_black, Bitmap3c400x300_1_red},
  1288. {Bitmap3c400x300_2_black, Bitmap3c400x300_2_red},
  1289. {WS_Bitmap3c400x300_black, WS_Bitmap3c400x300_red}
  1290. };
  1291. #else
  1292. bitmap_pair bitmap_pairs[] = {}; // not enough code space
  1293. #endif
  1294. if (display.epd2.panel == GxEPD2::GDEW042Z15)
  1295. {
  1296. for (uint16_t i = 0; i < sizeof(bitmap_pairs) / sizeof(bitmap_pair); i++)
  1297. {
  1298. display.fillScreen(GxEPD_WHITE);
  1299. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].black, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_BLACK);
  1300. display.drawInvertedBitmap(0, 0, bitmap_pairs[i].red, display.epd2.WIDTH, display.epd2.HEIGHT, GxEPD_RED);
  1301. display.display();
  1302. delay(2000);
  1303. }
  1304. }
  1305. }
  1306. #endif