GxEPD2_NotPagedExample.ino 79 KB

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