GxEPD2_SD_AVR_boards_added.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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: these e-papers require 3.3V supply AND data lines!
  3. //
  4. // Display Library based on Demo Example from Good Display: http://www.good-display.com/download_list/downloadcategoryid=34&isMode=false.html
  5. //
  6. // Author: Jean-Marc Zingg
  7. //
  8. // Version: see library.properties
  9. //
  10. // Library: https://github.com/ZinggJM/GxEPD2
  11. // non-AVR board can also be used with GxEPD2 base display classes, e.g. for SD bitmap drawing
  12. #ifndef _GxEPD2_SD_AVR_boards_added_H_
  13. #define _GxEPD2_SD_AVR_boards_added_H_
  14. #if defined (ESP8266)
  15. #define SD_CS SS // e.g. for RobotDyn Wemos D1 mini SD board
  16. #define EPD_CS D1 // alternative I use with RobotDyn Wemos D1 mini SD board
  17. // select one and adapt to your mapping
  18. //GxEPD2_154 display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  19. //GxEPD2_213 display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  20. //GxEPD2_290 display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  21. //GxEPD2_270 display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  22. //GxEPD2_420 display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  23. //GxEPD2_583 display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  24. //GxEPD2_750 display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  25. // 3-color e-papers
  26. // !!! can't be used for this //GxEPD2_154c display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  27. //GxEPD2_213c display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  28. //GxEPD2_290c display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  29. //GxEPD2_270c display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  30. //GxEPD2_420c display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  31. //GxEPD2_583c display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  32. //GxEPD2_750c display(/*CS=*/ EPD_CS, /*DC=D3*/ 0, /*RST=D4*/ 2, /*BUSY=D2*/ 4);
  33. #endif
  34. #if defined(ESP32)
  35. #define SD_CS 2 // adapt to your wiring
  36. #define EPD_CS SS // adapt to your wiring
  37. // select one and adapt to your mapping
  38. //GxEPD2_154 display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  39. //GxEPD2_213 display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  40. //GxEPD2_290 display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  41. //GxEPD2_270 display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  42. //GxEPD2_420 display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  43. //GxEPD2_583 display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  44. //GxEPD2_750 display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  45. // 3-color e-papers
  46. // !!! can't be used for this //GxEPD2_154c display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  47. //GxEPD2_213c display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  48. //GxEPD2_290c display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  49. //GxEPD2_270c display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  50. //GxEPD2_420c display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  51. //GxEPD2_583c display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  52. //GxEPD2_750c display(/*CS=5*/ EPD_CS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4);
  53. #endif
  54. #if defined(_BOARD_GENERIC_STM32F103C_H_)
  55. #define SD_CS 0 // adapt to your wiring
  56. #define EPD_CS SS // adapt to your wiring
  57. // select one and adapt to your mapping
  58. //GxEPD2_154 display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  59. //GxEPD2_213 display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  60. //GxEPD2_290 display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  61. //GxEPD2_270 display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  62. //GxEPD2_420 display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  63. //GxEPD2_583 display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  64. //GxEPD2_750 display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  65. // 3-color e-papers
  66. // !!! can't be used for this //GxEPD2_154c display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  67. //GxEPD2_213c display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  68. //GxEPD2_290c display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  69. //GxEPD2_270c display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  70. //GxEPD2_420c display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  71. //GxEPD2_583c display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  72. //GxEPD2_750c display(/*CS=4*/ EPD_CS, /*DC=*/ 3, /*RST=*/ 2, /*BUSY=*/ 1);
  73. #endif
  74. // Arduino DUE
  75. // mapping suggestion for Arduino DUE
  76. // BUSY -> 7, RST -> 9, DC -> 8, CS-> 77, CLK -> 76, DIN -> 75
  77. // SPI pins are on 6 pin 2x3 SPI header
  78. #if defined(ARDUINO_ARCH_SAM)
  79. #define SD_CS 0 // adapt to your wiring
  80. #define EPD_CS SS // adapt to your wiring
  81. // select one and adapt to your mapping
  82. //GxEPD2_154 display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  83. //GxEPD2_213 display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  84. //GxEPD2_290 display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  85. //GxEPD2_270 display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  86. //GxEPD2_420 display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  87. //GxEPD2_583 display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  88. //GxEPD2_750 display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  89. // 3-color e-papers
  90. // !!! can't be used for this //GxEPD2_154c display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  91. //GxEPD2_213c display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  92. //GxEPD2_290c display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  93. //GxEPD2_270c display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  94. //GxEPD2_420c display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  95. //GxEPD2_583c display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  96. //GxEPD2_750c display(/*CS=10*/ SS, /*DC=*/ 8, /*RST=*/ 9, /*BUSY=*/ 7);
  97. #endif
  98. // Arduino MKR1000 or MKRZERO
  99. // mapping suggestion for Arduino MKR1000 or MKRZERO
  100. // note: can't use SS on MKR1000: is defined as 24, should be 4
  101. // BUSY -> 5, RST -> 6, DC -> 7, CS-> 4, CLK -> 9, DIN -> 8
  102. #if defined(ARDUINO_ARCH_SAMD)
  103. #define SD_CS 0 // adapt to your wiring
  104. #define EPD_CS SS // adapt to your wiring
  105. // select one and adapt to your mapping
  106. //GxEPD2_154 display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  107. //GxEPD2_213 display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  108. //GxEPD2_290 display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  109. //GxEPD2_270 display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  110. //GxEPD2_420 display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  111. //GxEPD2_583 display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  112. //GxEPD2_750 display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  113. // 3-color e-papers
  114. // !!! can't be used for this //GxEPD2_154c display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  115. //GxEPD2_213c display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  116. //GxEPD2_290c display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  117. //GxEPD2_270c display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  118. //GxEPD2_420c display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  119. //GxEPD2_583c display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  120. //GxEPD2_750c display(/*CS=4*/ 4, /*DC=*/ 7, /*RST=*/ 6, /*BUSY=*/ 5);
  121. #endif
  122. #endif