GxEPD2.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. // Display Library 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. #ifndef _GxEPD2_H_
  12. #define _GxEPD2_H_
  13. #include <Arduino.h>
  14. #include <SPI.h>
  15. // color definitions for GxEPD, GxEPD2 and GxEPD_HD, values correspond to RGB565 values for TFTs
  16. #define GxEPD_BLACK 0x0000
  17. #define GxEPD_WHITE 0xFFFF
  18. // some controllers for b/w EPDs support grey levels
  19. #define GxEPD_DARKGREY 0x7BEF // 128, 128, 128
  20. #define GxEPD_LIGHTGREY 0xC618 // 192, 192, 192
  21. // values for 3-color or 7-color EPDs
  22. #define GxEPD_RED 0xF800 // 255, 0, 0
  23. #define GxEPD_YELLOW 0xFFE0 // 255, 255, 0 !!no longer same as GxEPD_RED!!
  24. #define GxEPD_COLORED GxEPD_RED
  25. // values for 7-color EPDs only
  26. #define GxEPD_BLUE 0x001F // 0, 0, 255
  27. #define GxEPD_GREEN 0x07E0 // 0, 255, 0
  28. #define GxEPD_ORANGE 0xFC00 // 255, 128, 0
  29. class GxEPD2
  30. {
  31. public:
  32. enum Panel
  33. {
  34. GDEW0102T4, Waveshare_1_02_bw = GDEW0102T4,
  35. GDEP015OC1, Waveshare_1_54_bw = GDEP015OC1,
  36. DEPG0150BN,
  37. GDEH0154D67, Waveshare_1_54_bw_D67 = GDEH0154D67,
  38. GDEW0154T8,
  39. GDEW0154M09,
  40. GDEW0154M10,
  41. GDEY0154D67,
  42. GDE0213B1, Waveshare_2_13_bw = GDE0213B1,
  43. GDEH0213B72, Waveshare_2_13_bw_B72 = GDEH0213B72,
  44. GDEH0213B73, Waveshare_2_13_bw_B73 = GDEH0213B73,
  45. GDEM0213B74,
  46. GDEW0213I5F, Waveshare_2_13_flex = GDEW0213I5F,
  47. GDEW0213M21,
  48. GDEW0213T5D,
  49. DEPG0213BN,
  50. GDEY0213B74,
  51. GDEW026T0, Waveshare_2_6_bw = GDEW026T0,
  52. GDEW026M01,
  53. DEPG0266BN,
  54. GDEY0266T90,
  55. GDEH029A1, Waveshare_2_9_bw = GDEH029A1,
  56. GDEW029T5, Waveshare_2_9_bw_T5 = GDEW029T5,
  57. GDEW029T5D,
  58. GDEW029I6FD,
  59. GDEW029M06,
  60. GDEM029T94,
  61. GDEY029T94,
  62. DEPG0290BS,
  63. GDEW027W3, Waveshare_2_7_bw = GDEW027W3,
  64. GDEY027T91,
  65. GDEQ031T10,
  66. ED037TC1,
  67. GDEW0371W7, Waveshare_3_7_bw = GDEW0371W7,
  68. GDEW042T2, Waveshare_4_2_bw = GDEW042T2,
  69. GDEW042M01,
  70. GDEY042T81,
  71. GDEQ0426T82,
  72. GDEW0583T7, Waveshare_5_83_bw = GDEW0583T7,
  73. GDEW0583T8,
  74. GDEQ0583T31,
  75. GDEW075T8, Waveshare_7_5_bw = GDEW075T8,
  76. GDEW075T7, Waveshare_7_5_bw_T7 = GDEW075T7,
  77. GDEY075T7,
  78. GDEH116T91,
  79. GDEW1248T3, Waveshare_12_24_bw = GDEW1248T3,
  80. ED060SCT, // on Waveshare IT8951 Driver HAT
  81. ED060KC1, // on Waveshare IT8951 Driver HAT 1448x1072
  82. ED078KC2, // on Waveshare IT8951 Driver HAT 1872x1404
  83. ES103TC1, // on Waveshare IT8951 Driver HAT 1872x1404
  84. // 3-color
  85. GDEW0154Z04, Waveshare_1_54_bwr = GDEW0154Z04,
  86. GDEH0154Z90, Waveshare_1_54_bwr_Z90 = GDEH0154Z90,
  87. GDEW0213Z16, Waveshare_2_13_bwr = GDEW0213Z16,
  88. GDEW0213Z19,
  89. GDEY0213Z98,
  90. GDEW029Z10, Waveshare_2_9_bwr = GDEW029Z10,
  91. GDEH029Z13,
  92. GDEM029C90,
  93. GDEY0266Z90, Waveshare_2_66_bwr = GDEY0266Z90,
  94. GDEW027C44, Waveshare_2_7_bwr = GDEW027C44,
  95. GDEW042Z15, Waveshare_4_2_bwr = GDEW042Z15,
  96. GDEQ042Z21, Waveshare_4_2_V2_bwr = GDEQ042Z21,
  97. GDEW0583Z21, Waveshare_5_83_bwr = GDEW0583Z21,
  98. GDEW0583Z83,
  99. GDEW075Z09, Waveshare_7_5_bwr = GDEW075Z09,
  100. GDEW075Z08, Waveshare_7_5_bwr_Z08 = GDEW075Z08,
  101. GDEH075Z90, Waveshare_7_5_bwr_Z90 = GDEH075Z90,
  102. GDEY1248Z51,
  103. // 4-color
  104. GDEY0266F51H,
  105. GDEY029F51H,
  106. Waveshare3inch4color,
  107. GDEY0420F51,
  108. Waveshare437inch4color,
  109. // 7-color
  110. ACeP565, Waveshare_5_65_7c = ACeP565,
  111. GDEY073D46,
  112. ACeP730, Waveshare_7_30_7c = ACeP730
  113. };
  114. };
  115. #endif