GxEPD2_NotPagedExample.ino 79 KB

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