9namespace waveshare_epaper {
11static const char *
const TAG =
"waveshare_epaper";
13static const uint8_t LUT_SIZE_WAVESHARE = 30;
15static const uint8_t FULL_UPDATE_LUT[LUT_SIZE_WAVESHARE] = {0x02, 0x02, 0x01, 0x11, 0x12, 0x12, 0x22, 0x22, 0x66, 0x69,
16 0x69, 0x59, 0x58, 0x99, 0x99, 0x88, 0x00, 0x00, 0x00, 0x00,
17 0xF8, 0xB4, 0x13, 0x51, 0x35, 0x51, 0x51, 0x19, 0x01, 0x00};
19static const uint8_t PARTIAL_UPDATE_LUT[LUT_SIZE_WAVESHARE] = {
20 0x10, 0x18, 0x18, 0x08, 0x18, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
21 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
23static const uint8_t LUT_SIZE_TTGO = 70;
25static const uint8_t FULL_UPDATE_LUT_TTGO[LUT_SIZE_TTGO] = {
26 0x80, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00,
27 0x10, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00,
28 0x80, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00,
29 0x10, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00,
30 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
31 0x03, 0x03, 0x00, 0x00, 0x02,
32 0x09, 0x09, 0x00, 0x00, 0x02,
33 0x03, 0x03, 0x00, 0x00, 0x02,
34 0x00, 0x00, 0x00, 0x00, 0x00,
35 0x00, 0x00, 0x00, 0x00, 0x00,
36 0x00, 0x00, 0x00, 0x00, 0x00,
37 0x00, 0x00, 0x00, 0x00, 0x00,
40static const uint8_t PARTIAL_UPDATE_LUT_TTGO[LUT_SIZE_TTGO] = {
41 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
42 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
43 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
44 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
45 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
46 0x0A, 0x00, 0x00, 0x00, 0x00,
47 0x00, 0x00, 0x00, 0x00, 0x00,
48 0x00, 0x00, 0x00, 0x00, 0x00,
49 0x00, 0x00, 0x00, 0x00, 0x00,
50 0x00, 0x00, 0x00, 0x00, 0x00,
51 0x00, 0x00, 0x00, 0x00, 0x00,
52 0x00, 0x00, 0x00, 0x00, 0x00,
55static const uint8_t LUT_SIZE_TTGO_B73 = 100;
57static const uint8_t FULL_UPDATE_LUT_TTGO_B73[LUT_SIZE_TTGO_B73] = {
58 0xA0, 0x90, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x90, 0xA0, 0x00, 0x00, 0x00, 0x00,
59 0x00, 0x00, 0x00, 0xA0, 0x90, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x90, 0xA0, 0x00,
60 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
62 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x03, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
63 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
64 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
67static const uint8_t PARTIAL_UPDATE_LUT_TTGO_B73[LUT_SIZE_TTGO_B73] = {
68 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
69 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
70 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
72 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
73 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
74 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
77static const uint8_t LUT_SIZE_TTGO_B1 = 29;
79static const uint8_t FULL_UPDATE_LUT_TTGO_B1[LUT_SIZE_TTGO_B1] = {
80 0x22, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
81 0x00, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x01, 0x00, 0x00, 0x00, 0x00};
83static const uint8_t PARTIAL_UPDATE_LUT_TTGO_B1[LUT_SIZE_TTGO_B1] = {
84 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
85 0x00, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
89static const uint8_t PARTIAL_UPD_2IN9_LUT_SIZE = 159;
90static const uint8_t PARTIAL_UPD_2IN9_LUT[PARTIAL_UPD_2IN9_LUT_SIZE] =
92 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
93 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
94 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
95 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
96 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
97 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
98 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
99 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
100 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
101 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
102 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
103 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
104 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
105 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
106 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
107 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
108 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
109 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00,
110 0x22, 0x17, 0x41, 0xB0, 0x32, 0x36,
160 const uint32_t start =
millis();
163 ESP_LOGE(TAG,
"Timeout while displaying image!");
177 Display::fill(color);
182 const uint8_t
fill = color.
is_on() ? 0x00 : 0xFF;
195 uint32_t small_buffer_length = buffer_length /
NUM_BUFFERS;
200 ESP_LOGE(TAG,
"Could not allocate buffer %d for display!", i);
201 for (
auto &buffer : this->
buffers_) {
202 allocator.
deallocate(buffer, small_buffer_length);
212 if (color.
red > 127) {
213 if (color.
green > 170) {
214 if (color.
blue > 127) {
219 }
else if (color.
green > 85) {
225 if (color.
green > 127) {
226 if (color.
blue > 127) {
232 if (color.
blue > 127) {
257 ESP_LOGE(TAG,
"Buffer unavailable!");
260 for (
auto &buffer : this->
buffers_) {
261 for (uint32_t buffer_pos = 0; buffer_pos < small_buffer_length; buffer_pos += 3) {
265 buffer[buffer_pos + 0] = pixel_color << 5 | pixel_color << 2 | pixel_color >> 1;
266 buffer[buffer_pos + 1] = pixel_color << 7 | pixel_color << 4 | pixel_color << 1 | pixel_color >> 2;
267 buffer[buffer_pos + 2] = pixel_color << 6 | pixel_color << 3 | pixel_color << 0;
275 ESP_LOGE(TAG,
"Buffer unavailable!");
280 uint8_t byte_to_send;
281 for (
auto &buffer : this->
buffers_) {
282 for (uint32_t buffer_pos = 0; buffer_pos < small_buffer_length; buffer_pos += 3) {
283 std::bitset<24> triplet =
284 buffer[buffer_pos + 0] << 16 | buffer[buffer_pos + 1] << 8 | buffer[buffer_pos + 2] << 0;
288 byte_to_send = ((triplet >> 17).to_ulong() & 0b01110000) | ((triplet >> 18).to_ulong() & 0b00000111);
289 this->
data(byte_to_send);
291 byte_to_send = ((triplet >> 11).to_ulong() & 0b01110000) | ((triplet >> 12).to_ulong() & 0b00000111);
292 this->
data(byte_to_send);
294 byte_to_send = ((triplet >> 5).to_ulong() & 0b01110000) | ((triplet >> 6).to_ulong() & 0b00000111);
295 this->
data(byte_to_send);
297 byte_to_send = ((triplet << 1).to_ulong() & 0b01110000) | ((triplet << 0).to_ulong() & 0b00000111);
298 this->
data(byte_to_send);
319 const uint8_t subpos =
x & 0x07;
321 if (!color.
is_on()) {
322 this->
buffer_[pos] |= 0x80 >> subpos;
324 this->
buffer_[pos] &= ~(0x80 >> subpos);
348 const uint8_t subpos =
x & 0x07;
351 this->
buffer_[pos] |= 0x80 >> subpos;
353 this->
buffer_[pos] &= ~(0x80 >> subpos);
357 if (((color.
red > 0) && (color.
green == 0) && (color.
blue == 0))) {
358 this->
buffer_[pos + buf_half_len] |= 0x80 >> subpos;
360 this->
buffer_[pos + buf_half_len] &= ~(0x80 >> subpos);
370 uint32_t first_bit_position = pixel_position * 3;
371 uint32_t byte_position = first_bit_position / 8u;
372 uint32_t byte_subposition = first_bit_position % 8u;
373 uint32_t buffer_position = byte_position / small_buffer_length;
374 uint32_t buffer_subposition = byte_position % small_buffer_length;
376 if (byte_subposition <= 5) {
377 this->
buffers_[buffer_position][buffer_subposition] =
378 (this->
buffers_[buffer_position][buffer_subposition] & (0xFF ^ (0b111 << (5 - byte_subposition)))) |
379 (pixel_bits << (5 - byte_subposition));
381 this->
buffers_[buffer_position][buffer_subposition + 0] =
382 (this->
buffers_[buffer_position][buffer_subposition + 0] & (0xFF ^ (0b111 >> (byte_subposition - 5)))) |
383 (pixel_bits >> (byte_subposition - 5));
385 this->
buffers_[buffer_position][buffer_subposition + 1] = (this->
buffers_[buffer_position][buffer_subposition + 1] &
386 (0xFF ^ (0xFF & (0b111 << (13 - byte_subposition))))) |
387 (pixel_bits << (13 - byte_subposition));
417 ESP_LOGI(TAG,
"Set the display to deep sleep");
482 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
485 ESP_LOGCONFIG(TAG,
" Model: 1.54in");
488 ESP_LOGCONFIG(TAG,
" Model: 1.54inV2");
491 ESP_LOGCONFIG(TAG,
" Model: 2.13in");
494 ESP_LOGCONFIG(TAG,
" Model: 2.13inV2");
497 ESP_LOGCONFIG(TAG,
" Model: 2.13in (TTGO)");
500 ESP_LOGCONFIG(TAG,
" Model: 2.13in (TTGO B73)");
503 ESP_LOGCONFIG(TAG,
" Model: 2.13in (TTGO B74)");
506 ESP_LOGCONFIG(TAG,
" Model: 2.13in (TTGO B1)");
509 ESP_LOGCONFIG(TAG,
" Model: 2.9in");
512 ESP_LOGCONFIG(TAG,
" Model: 2.9inV2");
517 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
519 LOG_UPDATE_INTERVAL(
this);
523 bool prev_full_update = this->
at_update_ == 1;
526 ESP_LOGI(TAG,
"Wake up the display");
538 if (full_update != prev_full_update) {
543 this->
write_lut_(full_update ? FULL_UPDATE_LUT_TTGO : PARTIAL_UPDATE_LUT_TTGO, LUT_SIZE_TTGO);
546 this->
write_lut_(full_update ? FULL_UPDATE_LUT_TTGO_B73 : PARTIAL_UPDATE_LUT_TTGO_B73, LUT_SIZE_TTGO_B73);
552 this->
write_lut_(full_update ? FULL_UPDATE_LUT_TTGO_B1 : PARTIAL_UPDATE_LUT_TTGO_B1, LUT_SIZE_TTGO_B1);
555 this->
write_lut_(full_update ? FULL_UPDATE_LUT : PARTIAL_UPDATE_LUT, LUT_SIZE_WAVESHARE);
564 this->
data(full_update ? 0x55 : 0x26);
586 this->
data(full_update ? 0x05 : 0x80);
590 this->
data(full_update ? 0x03 : 0x01);
652 for (
int j = 0; j < wb; j++) {
678 this->
data(full_update ? 0xF7 : 0xFF);
684 this->
data(full_update ? 0xC7 : 0x0C);
699 ESP_LOGI(TAG,
"Set the display back to deep sleep");
756 for (uint8_t i = 0; i < size; i++)
783static const uint8_t LUT_VCOM_DC_2_7[44] = {
784 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x00, 0x32, 0x32, 0x00, 0x00, 0x02, 0x00,
785 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
786 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
789static const uint8_t LUT_WHITE_TO_WHITE_2_7[42] = {
790 0x50, 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x60, 0x32, 0x32, 0x00, 0x00, 0x02, 0xA0, 0x0F,
791 0x0F, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
792 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
795static const uint8_t LUT_BLACK_TO_WHITE_2_7[42] = {
796 0x50, 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x60, 0x32, 0x32, 0x00, 0x00, 0x02, 0xA0, 0x0F,
797 0x0F, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
798 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
801static const uint8_t LUT_WHITE_TO_BLACK_2_7[] = {
802 0xA0, 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x60, 0x32, 0x32, 0x00, 0x00, 0x02, 0x50, 0x0F,
803 0x0F, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
804 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
807static const uint8_t LUT_BLACK_TO_BLACK_2_7[42] = {
808 0xA0, 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x60, 0x32, 0x32, 0x00, 0x00, 0x02, 0x50, 0x0F,
809 0x0F, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
810 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
873 for (uint8_t i : LUT_VCOM_DC_2_7)
878 for (uint8_t i : LUT_WHITE_TO_WHITE_2_7)
882 for (uint8_t i : LUT_BLACK_TO_WHITE_2_7)
886 for (uint8_t i : LUT_WHITE_TO_BLACK_2_7)
890 for (uint8_t i : LUT_BLACK_TO_BLACK_2_7)
899 for (uint32_t i = 0; i < buf_len; i++) {
907 for (uint32_t i = 0; i < buf_len; i++) {
917 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
918 ESP_LOGCONFIG(TAG,
" Model: 2.7in");
920 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
922 LOG_UPDATE_INTERVAL(
this);
970 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
971 ESP_LOGCONFIG(TAG,
" Model: 2.7in V2");
973 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
975 LOG_UPDATE_INTERVAL(
this);
1033 for (uint32_t i = 0; i < buf_len_half; i++) {
1041 for (uint32_t i = buf_len_half; i < buf_len_half * 2u; i++) {
1054 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1055 ESP_LOGCONFIG(TAG,
" Model: 1.54in V2 B");
1057 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1058 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1059 LOG_UPDATE_INTERVAL(
this);
1069static const uint8_t LUT_VCOM_DC_2_7B[44] = {0x00, 0x00, 0x00, 0x1A, 0x1A, 0x00, 0x00, 0x01, 0x00, 0x0A, 0x0A,
1070 0x00, 0x00, 0x08, 0x00, 0x0E, 0x01, 0x0E, 0x01, 0x10, 0x00, 0x0A,
1071 0x0A, 0x00, 0x00, 0x08, 0x00, 0x04, 0x10, 0x00, 0x00, 0x05, 0x00,
1072 0x03, 0x0E, 0x00, 0x00, 0x0A, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01};
1074static const uint8_t LUT_WHITE_TO_WHITE_2_7B[42] = {0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01, 0x40, 0x0A, 0x0A, 0x00, 0x00,
1075 0x08, 0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10, 0x80, 0x0A, 0x0A, 0x00,
1076 0x00, 0x08, 0x00, 0x04, 0x10, 0x00, 0x00, 0x05, 0x00, 0x03, 0x0E,
1077 0x00, 0x00, 0x0A, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01};
1079static const uint8_t LUT_BLACK_TO_WHITE_2_7B[42] = {0xA0, 0x1A, 0x1A, 0x00, 0x00, 0x01, 0x00, 0x0A, 0x0A, 0x00, 0x00,
1080 0x08, 0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10, 0x90, 0x0A, 0x0A, 0x00,
1081 0x00, 0x08, 0xB0, 0x04, 0x10, 0x00, 0x00, 0x05, 0xB0, 0x03, 0x0E,
1082 0x00, 0x00, 0x0A, 0xC0, 0x23, 0x00, 0x00, 0x00, 0x01};
1084static const uint8_t LUT_WHITE_TO_BLACK_2_7B[] = {0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01, 0x20, 0x0A, 0x0A, 0x00, 0x00,
1085 0x08, 0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10, 0x10, 0x0A, 0x0A, 0x00,
1086 0x00, 0x08, 0x00, 0x04, 0x10, 0x00, 0x00, 0x05, 0x00, 0x03, 0x0E,
1087 0x00, 0x00, 0x0A, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01};
1089static const uint8_t LUT_BLACK_TO_BLACK_2_7B[42] = {0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01, 0x40, 0x0A, 0x0A, 0x00, 0x00,
1090 0x08, 0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10, 0x80, 0x0A, 0x0A, 0x00,
1091 0x00, 0x08, 0x00, 0x04, 0x10, 0x00, 0x00, 0x05, 0x00, 0x03, 0x0E,
1092 0x00, 0x00, 0x0A, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01};
1151 for (uint8_t i : LUT_VCOM_DC_2_7B)
1155 for (uint8_t i : LUT_WHITE_TO_WHITE_2_7B)
1159 for (uint8_t i : LUT_BLACK_TO_WHITE_2_7B)
1163 for (uint8_t i : LUT_WHITE_TO_BLACK_2_7B) {
1169 for (uint8_t i : LUT_BLACK_TO_BLACK_2_7B) {
1190 for (uint32_t i = 0; i < buf_len_half; i++) {
1199 for (uint32_t i = buf_len_half; i < buf_len_half * 2u; i++) {
1215 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1216 ESP_LOGCONFIG(TAG,
" Model: 2.7in B");
1218 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1219 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1220 LOG_UPDATE_INTERVAL(
this);
1252 this->
data((xend >> 3) & 0xff);
1257 this->
data(yend & 0xff);
1258 this->
data((yend >> 8) & 0xff);
1273 for (uint32_t i = 0; i < buf_len; i++) {
1281 for (uint32_t i = 0; i < buf_len; i++) {
1294 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1295 ESP_LOGCONFIG(TAG,
" Model: 2.7in B V2");
1297 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1298 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1299 LOG_UPDATE_INTERVAL(
this);
1373 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1374 ESP_LOGCONFIG(TAG,
" Model: 2.9in (B)");
1376 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1377 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1378 LOG_UPDATE_INTERVAL(
this);
1460 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1461 ESP_LOGCONFIG(TAG,
" Model: 2.9in (D)");
1463 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1464 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1465 LOG_UPDATE_INTERVAL(
this);
1471static const uint8_t LUT_SIZE_DKE = 70;
1472static const uint8_t UPDATE_LUT_DKE[LUT_SIZE_DKE] = {
1473 0xA0, 0x90, 0x50, 0x0, 0x0, 0x0, 0x0, 0x50, 0x90, 0xA0, 0x0, 0x0, 0x0, 0x0, 0xA0, 0x90, 0x50, 0x0,
1474 0x0, 0x0, 0x0, 0x50, 0x90, 0xA0, 0x0, 0x0, 0x0, 0x0, 0x00, 0x00, 0x00, 0x0, 0x0, 0x0, 0x0, 0xF,
1475 0xF, 0x0, 0x0, 0x0, 0xF, 0xF, 0x0, 0x0, 0x02, 0xF, 0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1476 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1478static const uint8_t PART_UPDATE_LUT_DKE[LUT_SIZE_DKE] = {
1479 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x50, 0x10, 0x00, 0x00,
1480 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
1481 0x05, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1482 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
1483static const uint8_t FULL_UPDATE_LUT_DKE[LUT_SIZE_DKE] = {
1484 0x90, 0x50, 0xa0, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x10, 0xa0, 0xa0, 0x80, 0x00, 0x90, 0x50, 0xa0, 0x50,
1485 0x50, 0x00, 0x00, 0x00, 0x00, 0x10, 0xa0, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17,
1486 0x04, 0x00, 0x00, 0x00, 0x0b, 0x04, 0x00, 0x00, 0x00, 0x06, 0x05, 0x00, 0x00, 0x00, 0x04, 0x05, 0x00, 0x00,
1487 0x00, 0x01, 0x0e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
1551 for (uint8_t v : FULL_UPDATE_LUT_DKE)
1556 ESP_LOGI(TAG,
"Performing e-paper update.");
1582 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1583 ESP_LOGCONFIG(TAG,
" Model: 2.9in DKE");
1585 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1586 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1587 LOG_UPDATE_INTERVAL(
this);
1654 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1655 ESP_LOGCONFIG(TAG,
" Model: 2.9in (B) V3");
1657 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1658 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1659 LOG_UPDATE_INTERVAL(
this);
1710void WaveshareEPaper2P9InV2R2::reset_() {
1722 ESP_LOGE(TAG,
"fail idle 1");
1761 this->
write_lut_(PARTIAL_UPD_2IN9_LUT, PARTIAL_UPD_2IN9_LUT_SIZE);
1783 ESP_LOGE(TAG,
"fail idle 2");
1822 for (uint8_t i = 0; i < size; i++)
1827 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1828 ESP_LOGCONFIG(TAG,
" Model: 2.9inV2R2");
1831 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1832 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1833 LOG_UPDATE_INTERVAL(
this);
1913 LOG_DISPLAY(
"",
"E-Paper (Good Display)",
this);
1914 ESP_LOGCONFIG(TAG,
" Model: 2.9in GDEY029T94");
1916 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1917 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1918 LOG_UPDATE_INTERVAL(
this);
1931static const uint8_t LUT_20_VCOMDC_29_5[] = {
1932 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x60, 0x28, 0x28, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00,
1933 0x00, 0x00, 0x01, 0x00, 0x12, 0x12, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1934 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1937static const uint8_t LUT_21_WW_29_5[] = {
1938 0x40, 0x08, 0x00, 0x00, 0x00, 0x02, 0x90, 0x28, 0x28, 0x00, 0x00, 0x01, 0x40, 0x14,
1939 0x00, 0x00, 0x00, 0x01, 0xA0, 0x12, 0x12, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
1940 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1943static const uint8_t LUT_22_BW_29_5[] = {
1944 0x40, 0x08, 0x00, 0x00, 0x00, 0x02, 0x90, 0x28, 0x28, 0x00, 0x00, 0x01, 0x40, 0x14,
1945 0x00, 0x00, 0x00, 0x01, 0xA0, 0x12, 0x12, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
1946 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1949static const uint8_t LUT_23_WB_29_5[] = {
1950 0x80, 0x08, 0x00, 0x00, 0x00, 0x02, 0x90, 0x28, 0x28, 0x00, 0x00, 0x01, 0x80, 0x14,
1951 0x00, 0x00, 0x00, 0x01, 0x50, 0x12, 0x12, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
1952 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1955static const uint8_t LUT_24_BB_29_5[] = {
1956 0x80, 0x08, 0x00, 0x00, 0x00, 0x02, 0x90, 0x28, 0x28, 0x00, 0x00, 0x01, 0x80, 0x14,
1957 0x00, 0x00, 0x00, 0x01, 0x50, 0x12, 0x12, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
1958 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1962static const uint8_t LUT_20_VCOMDC_PARTIAL_29_5[] = {
1963 0x00, 0x20, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1964 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1965 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1968static const uint8_t LUT_21_WW_PARTIAL_29_5[] = {
1969 0x00, 0x20, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1970 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1971 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1974static const uint8_t LUT_22_BW_PARTIAL_29_5[] = {
1975 0x80, 0x20, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1976 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1977 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1980static const uint8_t LUT_23_WB_PARTIAL_29_5[] = {
1981 0x40, 0x20, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1982 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1983 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1986static const uint8_t LUT_24_BB_PARTIAL_29_5[] = {
1987 0x00, 0x20, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1988 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1989 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1993 if (!this->power_is_on_) {
1997 this->power_is_on_ =
true;
2003 this->power_is_on_ =
false;
2008 if (this->deep_sleep_between_updates_) {
2011 ESP_LOGD(TAG,
"go to deep sleep");
2012 this->is_deep_sleep_ =
true;
2020 if (this->deep_sleep_between_updates_ && this->is_deep_sleep_) {
2021 ESP_LOGI(TAG,
"wake up from deep sleep");
2023 this->is_deep_sleep_ =
false;
2051 this->
data(0b10111111);
2060 ESP_LOGD(TAG,
"panel setting done");
2066 this->deep_sleep_between_updates_ =
true;
2071 if (this->old_buffer_ ==
nullptr) {
2072 ESP_LOGE(TAG,
"Could not allocate old buffer for display!");
2076 this->old_buffer_[i] = 0xFF;
2088 this->
write_lut_(LUT_20_VCOMDC_29_5,
sizeof(LUT_20_VCOMDC_29_5));
2090 this->
write_lut_(LUT_21_WW_29_5,
sizeof(LUT_21_WW_29_5));
2092 this->
write_lut_(LUT_22_BW_29_5,
sizeof(LUT_22_BW_29_5));
2094 this->
write_lut_(LUT_23_WB_29_5,
sizeof(LUT_23_WB_29_5));
2096 this->
write_lut_(LUT_24_BB_29_5,
sizeof(LUT_24_BB_29_5));
2097 ESP_LOGD(TAG,
"initialized full update");
2108 this->
write_lut_(LUT_20_VCOMDC_PARTIAL_29_5,
sizeof(LUT_20_VCOMDC_PARTIAL_29_5));
2110 this->
write_lut_(LUT_21_WW_PARTIAL_29_5,
sizeof(LUT_21_WW_PARTIAL_29_5));
2112 this->
write_lut_(LUT_22_BW_PARTIAL_29_5,
sizeof(LUT_22_BW_PARTIAL_29_5));
2114 this->
write_lut_(LUT_23_WB_PARTIAL_29_5,
sizeof(LUT_23_WB_PARTIAL_29_5));
2116 this->
write_lut_(LUT_24_BB_PARTIAL_29_5,
sizeof(LUT_24_BB_PARTIAL_29_5));
2117 ESP_LOGD(TAG,
"initialized partial update");
2121 bool full_update = this->at_update_ == 0;
2155 this->old_buffer_[i] = this->
buffer_[i];
2166 ESP_LOGD(TAG,
"full update done");
2169 ESP_LOGD(TAG,
"partial update done");
2172 this->at_update_ = (this->at_update_ + 1) % this->full_update_every_;
2180 for (uint8_t i = 0; i < size; i++)
2190 LOG_DISPLAY(
"",
"Waveshare E-Paper (Good Display)",
this);
2191 ESP_LOGCONFIG(TAG,
" Model: 2.9in Greyscale GDEW029T5");
2193 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
2194 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
2195 ESP_LOGCONFIG(TAG,
" Full Update Every: %" PRIu32, this->full_update_every_);
2196 LOG_UPDATE_INTERVAL(
this);
2213 this->init_internal_();
2216 if (this->lastbuff_ !=
nullptr) {
2222void GDEW0154M09::reset_() {
2232void GDEW0154M09::init_internal_() {
2243 const uint8_t panel_setting_1 = 0b11011111;
2250 const uint8_t panel_setting_2 = 0b01110;
2252 const uint8_t wf_t0154_cz_b3_list[] = {
2254 CMD_PSR_PANEL_SETTING, 2, panel_setting_1, panel_setting_2,
2255 CMD_UNDOCUMENTED_0x4D, 1, 0x55,
2256 CMD_UNDOCUMENTED_0xAA, 1, 0x0f,
2257 CMD_UNDOCUMENTED_0xE9, 1, 0x02,
2258 CMD_UNDOCUMENTED_0xB6, 1, 0x11,
2259 CMD_UNDOCUMENTED_0xF3, 1, 0x0a,
2260 CMD_TRES_RESOLUTION_SETTING, 3, 0xc8, 0x00, 0xc8,
2261 CMD_TCON_TCONSETTING, 1, 0x00,
2262 CMD_CDI_VCOM_DATA_INTERVAL, 1, 0xd7,
2263 CMD_PWS_POWER_SAVING, 1, 0x00,
2268 this->write_init_list_(wf_t0154_cz_b3_list);
2273void GDEW0154M09::write_init_list_(
const uint8_t *list) {
2274 uint8_t list_limit = list[0];
2275 uint8_t *start_ptr = ((uint8_t *) list + 1);
2276 for (uint8_t i = 0; i < list_limit; i++) {
2277 this->
command(*(start_ptr + 0));
2278 for (uint8_t dnum = 0; dnum < *(start_ptr + 1); dnum++) {
2279 this->
data(*(start_ptr + 2 + dnum));
2281 start_ptr += (*(start_ptr + 1) + 2);
2285void GDEW0154M09::clear_() {
2287 for (uint8_t j = 0; j < 2; j++) {
2288 this->
command(CMD_DTM1_DATA_START_TRANS);
2289 for (uint32_t count = 0; count < pixsize; count++) {
2292 this->
command(CMD_DTM2_DATA_START_TRANS2);
2293 for (uint32_t count = 0; count < pixsize; count++) {
2296 this->
command(CMD_DISPLAY_REFRESH);
2303 this->init_internal_();
2305 this->
command(CMD_DTM1_DATA_START_TRANS);
2309 this->
command(CMD_DTM2_DATA_START_TRANS2);
2313 this->
command(CMD_DISPLAY_REFRESH);
2321 this->
command(CMD_POF_POWER_OFF);
2324 this->
command(CMD_DSLP_DEEP_SLEEP);
2325 this->
data(DATA_DSLP_DEEP_SLEEP);
2331 LOG_DISPLAY(
"",
"M5Stack CoreInk E-Paper (Good Display)",
this);
2332 ESP_LOGCONFIG(TAG,
" Model: 1.54in Greyscale GDEW0154M09");
2334 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
2335 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
2336 LOG_UPDATE_INTERVAL(
this);
2353 this->init_display_();
2354 ESP_LOGD(TAG,
"Initialization complete, set the display to deep sleep");
2367void GDEY042T81::reset_() {
2376void GDEY042T81::init_display_() {
2422void GDEY042T81::update_full_() {
2443void GDEY042T81::update_part_() {
2456 ESP_LOGD(TAG,
"Wake up the display");
2457 this->init_display_();
2461 ESP_LOGE(TAG,
"Failed to perform update, display is busy");
2467 ESP_LOGD(TAG,
"Full update");
2475 this->update_full_();
2481 ESP_LOGD(TAG,
"Update");
2494 this->update_full_();
2503 ESP_LOGD(TAG,
"Partial update");
2507 ESP_LOGE(TAG,
"Failed to perform partial update, display is busy");
2517 this->update_part_();
2522 ESP_LOGD(TAG,
"Set the display back to deep sleep");
2530 LOG_DISPLAY(
"",
"GoodDisplay E-Paper",
this);
2531 ESP_LOGCONFIG(TAG,
" Model: 4.2in B/W GDEY042T81");
2534 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
2535 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
2536 LOG_UPDATE_INTERVAL(
this);
2539static const uint8_t LUT_VCOM_DC_4_2[] = {
2540 0x00, 0x17, 0x00, 0x00, 0x00, 0x02, 0x00, 0x17, 0x17, 0x00, 0x00, 0x02, 0x00, 0x0A, 0x01,
2541 0x00, 0x00, 0x01, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2542 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2544static const uint8_t LUT_WHITE_TO_WHITE_4_2[] = {
2545 0x40, 0x17, 0x00, 0x00, 0x00, 0x02, 0x90, 0x17, 0x17, 0x00, 0x00, 0x02, 0x40, 0x0A,
2546 0x01, 0x00, 0x00, 0x01, 0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
2547 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2549static const uint8_t LUT_BLACK_TO_WHITE_4_2[] = {
2550 0x40, 0x17, 0x00, 0x00, 0x00, 0x02, 0x90, 0x17, 0x17, 0x00, 0x00, 0x02, 0x40, 0x0A,
2551 0x01, 0x00, 0x00, 0x01, 0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
2552 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2555static const uint8_t LUT_BLACK_TO_BLACK_4_2[] = {
2556 0x80, 0x17, 0x00, 0x00, 0x00, 0x02, 0x90, 0x17, 0x17, 0x00, 0x00, 0x02, 0x80, 0x0A,
2557 0x01, 0x00, 0x00, 0x01, 0x50, 0x0E, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
2558 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2561static const uint8_t LUT_WHITE_TO_BLACK_4_2[] = {
2562 0x80, 0x17, 0x00, 0x00, 0x00, 0x02, 0x90, 0x17, 0x17, 0x00, 0x00, 0x02, 0x80, 0x0A,
2563 0x01, 0x00, 0x00, 0x01, 0x50, 0x0E, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
2564 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
2599 for (uint8_t i : LUT_VCOM_DC_4_2)
2603 for (uint8_t i : LUT_WHITE_TO_WHITE_4_2)
2607 for (uint8_t i : LUT_BLACK_TO_WHITE_4_2)
2611 for (uint8_t i : LUT_WHITE_TO_BLACK_4_2)
2615 for (uint8_t i : LUT_BLACK_TO_BLACK_4_2)
2653 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
2654 ESP_LOGCONFIG(TAG,
" Model: 4.2in");
2656 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
2657 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
2658 LOG_UPDATE_INTERVAL(
this);
2709 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
2710 ESP_LOGCONFIG(TAG,
" Model: 4.2in (B V2)");
2712 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
2713 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
2714 LOG_UPDATE_INTERVAL(
this);
2745 for (uint32_t i = 0; i < buf_len; ++i) {
2751 for (uint32_t i = 0; i < buf_len; ++i) {
2767 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
2768 ESP_LOGCONFIG(TAG,
" Model: 4.2in (B V2) BWR-Mode");
2770 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
2771 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
2772 LOG_UPDATE_INTERVAL(
this);
2833 uint8_t temp1 = this->
buffer_[i];
2834 for (uint8_t j = 0; j < 8; j++) {
2864 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
2865 ESP_LOGCONFIG(TAG,
" Model: 5.83in");
2867 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
2868 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
2869 LOG_UPDATE_INTERVAL(
this);
2945 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
2946 ESP_LOGCONFIG(TAG,
" Model: 5.83inv2");
2948 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
2949 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
2950 LOG_UPDATE_INTERVAL(
this);
2970 if (this->old_buffer_ ==
nullptr) {
2971 ESP_LOGE(TAG,
"Could not allocate old buffer for display!");
2983void GDEY0583T81::power_on_() {
2984 if (!this->power_is_on_) {
2988 this->power_is_on_ =
true;
2989 this->is_deep_sleep_ =
false;
2992void GDEY0583T81::power_off_() {
2995 this->power_is_on_ =
false;
2999 if (this->is_deep_sleep_) {
3013 this->is_deep_sleep_ =
true;
3016void GDEY0583T81::reset_() {
3026void GDEY0583T81::init_full_() {
3027 this->init_display_();
3045void GDEY0583T81::init_partial_() {
3046 this->init_display_();
3057void GDEY0583T81::init_display_() {
3086 bool full_update = this->at_update_ == 0;
3090 this->init_partial_();
3134 this->old_buffer_[i] = this->
buffer_[i];
3143 ESP_LOGD(TAG,
"Full update done");
3147 ESP_LOGD(TAG,
"Partial update done, next full update after %" PRIu32
" cycles",
3148 this->full_update_every_ - this->at_update_ - 1);
3151 this->at_update_ = (this->at_update_ + 1) % this->full_update_every_;
3161 LOG_DISPLAY(
"",
"GoodDisplay E-Paper",
this);
3162 ESP_LOGCONFIG(TAG,
" Model: 5.83in B/W GDEY0583T81");
3163 ESP_LOGCONFIG(TAG,
" Full Update Every: %" PRIu32, this->full_update_every_);
3165 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
3166 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
3167 LOG_UPDATE_INTERVAL(
this);
3238 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
3239 ESP_LOGCONFIG(TAG,
" Model: 7.5in-bv2");
3241 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
3242 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
3243 LOG_UPDATE_INTERVAL(
this);
3252 const uint32_t start =
millis();
3256 ESP_LOGI(TAG,
"Timeout while displaying image!");
3321 uint8_t lut_vcom_7_i_n5_v2[] = {
3322 0x0, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0xF, 0x1, 0xF, 0x1, 0x2, 0x0, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
3323 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
3326 uint8_t lut_ww_7_i_n5_v2[] = {
3327 0x10, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x20, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
3328 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
3331 uint8_t lut_bw_7_i_n5_v2[] = {
3332 0x10, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x20, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
3333 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
3336 uint8_t lut_wb_7_i_n5_v2[] = {
3337 0x80, 0xF, 0xF, 0x0, 0x0, 0x3, 0x84, 0xF, 0x1, 0xF, 0x1, 0x4, 0x40, 0xF, 0xF, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0,
3338 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
3341 uint8_t lut_bb_7_i_n5_v2[] = {
3342 0x80, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x40, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
3343 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
3348 for (count = 0; count < 42; count++)
3349 this->
data(lut_vcom_7_i_n5_v2[count]);
3352 for (count = 0; count < 42; count++)
3353 this->
data(lut_ww_7_i_n5_v2[count]);
3356 for (count = 0; count < 42; count++)
3357 this->
data(lut_bw_7_i_n5_v2[count]);
3360 for (count = 0; count < 42; count++)
3361 this->
data(lut_wb_7_i_n5_v2[count]);
3364 for (count = 0; count < 42; count++)
3365 this->
data(lut_bb_7_i_n5_v2[count]);
3372 for (uint32_t i = 0; i < buf_len; i++) {
3378 for (uint32_t i = 0; i < buf_len; i++) {
3390 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
3391 ESP_LOGCONFIG(TAG,
" Model: 7.5in-bv3");
3393 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
3394 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
3395 LOG_UPDATE_INTERVAL(
this);
3404 const uint32_t start =
millis();
3408 ESP_LOGI(TAG,
"Timeout while displaying image!");
3472 for (uint32_t i = 0; i < buf_len; i++) {
3478 for (uint32_t i = 0; i < buf_len; i++) {
3490 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
3491 ESP_LOGCONFIG(TAG,
" Model: 7.5in-bv3 BWR-Mode");
3493 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
3494 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
3495 LOG_UPDATE_INTERVAL(
this);
3545 uint8_t temp1 = this->
buffer_[i];
3546 for (uint8_t j = 0; j < 8; j++) {
3573 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
3574 ESP_LOGCONFIG(TAG,
" Model: 7.5in");
3576 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
3577 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
3578 LOG_UPDATE_INTERVAL(
this);
3583namespace cmddata_5P65InF {
3592static const uint8_t R00_CMD_PSR[] = {0x00, 0xEF, 0x08};
3596static const uint8_t R01_CMD_PWR[] = {0x01, 0x07, 0x00, 0x00, 0x00};
3599static const uint8_t R02_CMD_POF[] = {0x02};
3603static const uint8_t R03_CMD_PFS[] = {0x03, 0x00};
3606static const uint8_t R04_CMD_PON[] = {0x04};
3609static const uint8_t R06_CMD_BTST[] = {0x06, 0xC7, 0xC7, 0x1D};
3614static const uint8_t R07_CMD_DSLP[] = {0x07, 0xA5};
3618static const uint8_t R10_CMD_DTM1[] = {0x10};
3621static const uint8_t R11_CMD_DSP[] = {0x11};
3624static const uint8_t R12_CMD_DRF[] = {0x12};
3627static const uint8_t R13_CMD_IPC[] = {0x13, 0x00};
3631static const uint8_t R30_CMD_PLL[] = {0x30, 0x3C};
3635static const uint8_t R41_CMD_TSE[] = {0x41, 0x00};
3640static const uint8_t R50_CMD_CDI[] = {0x50, 0x37};
3645static const uint8_t R60_CMD_TCON[] = {0x60, 0x22};
3650static const uint8_t R61_CMD_TRES[] = {0x61, 0x02, 0x58, 0x01, 0xC0};
3653static const uint8_t RE3_CMD_PWS[] = {0xE3, 0xAA};
3657 if (this->
buffers_[0] ==
nullptr) {
3658 ESP_LOGE(TAG,
"Buffer unavailable!");
3666 using namespace cmddata_5P65InF;
3668 this->
cmd_data(R00_CMD_PSR,
sizeof(R00_CMD_PSR));
3669 this->
cmd_data(R01_CMD_PWR,
sizeof(R01_CMD_PWR));
3670 this->
cmd_data(R03_CMD_PFS,
sizeof(R03_CMD_PFS));
3671 this->
cmd_data(R06_CMD_BTST,
sizeof(R06_CMD_BTST));
3672 this->
cmd_data(R30_CMD_PLL,
sizeof(R30_CMD_PLL));
3673 this->
cmd_data(R41_CMD_TSE,
sizeof(R41_CMD_TSE));
3674 this->
cmd_data(R50_CMD_CDI,
sizeof(R50_CMD_CDI));
3675 this->
cmd_data(R60_CMD_TCON,
sizeof(R60_CMD_TCON));
3676 this->
cmd_data(R61_CMD_TRES,
sizeof(R61_CMD_TRES));
3677 this->
cmd_data(RE3_CMD_PWS,
sizeof(RE3_CMD_PWS));
3680 this->
cmd_data(R50_CMD_CDI,
sizeof(R50_CMD_CDI));
3682 ESP_LOGI(TAG,
"Display initialized successfully");
3687 ESP_LOGI(TAG,
"Initialise the display");
3690 using namespace cmddata_5P65InF;
3693 ESP_LOGI(TAG,
"Sending data to the display");
3694 this->
cmd_data(R61_CMD_TRES,
sizeof(R61_CMD_TRES));
3695 this->
cmd_data(R10_CMD_DTM1,
sizeof(R10_CMD_DTM1));
3699 ESP_LOGI(TAG,
"Power on the display");
3700 this->
cmd_data(R04_CMD_PON,
sizeof(R04_CMD_PON));
3704 ESP_LOGI(TAG,
"Refresh the display");
3705 this->
cmd_data(R12_CMD_DRF,
sizeof(R12_CMD_DRF));
3709 ESP_LOGI(TAG,
"Power off the display");
3710 this->
cmd_data(R02_CMD_POF,
sizeof(R02_CMD_POF));
3714 ESP_LOGI(TAG,
"Set the display to deep sleep");
3715 this->
cmd_data(R07_CMD_DSLP,
sizeof(R07_CMD_DSLP));
3724 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
3725 ESP_LOGCONFIG(TAG,
" Model: 5.65in-F");
3727 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
3728 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
3729 LOG_UPDATE_INTERVAL(
this);
3737 const uint32_t start =
millis();
3740 ESP_LOGE(TAG,
"Timeout while displaying image!");
3750 if (this->
buffers_[0] ==
nullptr) {
3751 ESP_LOGE(TAG,
"Buffer unavailable!");
3850 ESP_LOGI(TAG,
"Display initialized successfully");
3854 ESP_LOGI(TAG,
"Initialise the display");
3858 ESP_LOGI(TAG,
"Sending data to the display");
3863 ESP_LOGI(TAG,
"Power on the display");
3868 ESP_LOGI(TAG,
"Refresh the display");
3874 ESP_LOGI(TAG,
"Power off the display");
3880 ESP_LOGI(TAG,
"Set the display to deep sleep");
3889 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
3890 ESP_LOGCONFIG(TAG,
" Model: 7.3in-F");
3892 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
3893 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
3894 LOG_UPDATE_INTERVAL(
this);
3901 const uint32_t start =
millis();
3904 ESP_LOGE(TAG,
"Timeout while displaying image!");
3918 const uint32_t start =
millis();
3922 ESP_LOGE(TAG,
"Timeout while displaying image!");
3977 ESP_LOGI(TAG,
"Power on the display and hat");
3989 for (uint32_t i = 0; i < buf_len; i++) {
4001 ESP_LOGV(TAG,
"Before command(0x02) (>> power off)");
4004 ESP_LOGV(TAG,
"After command(0x02) (>> power off)");
4011 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
4012 ESP_LOGCONFIG(TAG,
" Model: 7.5inV2rev2");
4014 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
4015 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
4016 LOG_UPDATE_INTERVAL(
this);
4025 const uint32_t start =
millis();
4029 ESP_LOGI(TAG,
"Timeout while displaying image!");
4095 uint8_t lut_vcom_7_i_n5_v2[] = {
4096 0x0, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0xF, 0x1, 0xF, 0x1, 0x2, 0x0, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
4097 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4100 uint8_t lut_ww_7_i_n5_v2[] = {
4101 0x10, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x20, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
4102 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4105 uint8_t lut_bw_7_i_n5_v2[] = {
4106 0x10, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x20, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
4107 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4110 uint8_t lut_wb_7_i_n5_v2[] = {
4111 0x80, 0xF, 0xF, 0x0, 0x0, 0x3, 0x84, 0xF, 0x1, 0xF, 0x1, 0x4, 0x40, 0xF, 0xF, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0,
4112 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4115 uint8_t lut_bb_7_i_n5_v2[] = {
4116 0x80, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x40, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
4117 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4122 for (count = 0; count < 42; count++)
4123 this->
data(lut_vcom_7_i_n5_v2[count]);
4126 for (count = 0; count < 42; count++)
4127 this->
data(lut_ww_7_i_n5_v2[count]);
4130 for (count = 0; count < 42; count++)
4131 this->
data(lut_bw_7_i_n5_v2[count]);
4134 for (count = 0; count < 42; count++)
4135 this->
data(lut_wb_7_i_n5_v2[count]);
4138 for (count = 0; count < 42; count++)
4139 this->
data(lut_bb_7_i_n5_v2[count]);
4143 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
4144 ESP_LOGCONFIG(TAG,
" Model: 7.5inV2");
4146 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
4147 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
4148 LOG_UPDATE_INTERVAL(
this);
4157 const uint32_t start =
millis();
4161 ESP_LOGE(TAG,
"Timeout while displaying image!");
4170void WaveshareEPaper7P5InV2P::reset_() {
4181void WaveshareEPaper7P5InV2P::turn_on_display_() {
4247 ESP_LOGI(TAG,
"Power on the display and hat");
4255 for (uint32_t i = 0; i < buf_len; i++) {
4259 this->turn_on_display_();
4279 for (uint32_t i = 0; i < buf_len; i++) {
4288 for (uint32_t i = 0; i < buf_len; i++) {
4295 this->turn_on_display_();
4320 for (uint32_t i = 0; i < buf_len; i++) {
4327 this->turn_on_display_();
4330 ESP_LOGV(TAG,
"Before command(0x02) (>> power off)");
4333 ESP_LOGV(TAG,
"After command(0x02) (>> power off)");
4342 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
4343 ESP_LOGCONFIG(TAG,
" Model: 7.50inv2p");
4346 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
4347 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
4348 LOG_UPDATE_INTERVAL(
this);
4413 uint8_t eight_pixels = this->
buffer_[i];
4415 for (uint8_t j = 0; j < 8; j += 2) {
4419 uint8_t left_nibble = (eight_pixels & 0x80) ? 0x30 : 0x00;
4421 uint8_t right_nibble = (eight_pixels & 0x80) ? 0x03 : 0x00;
4423 this->
write_byte(left_nibble | right_nibble);
4442 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
4443 ESP_LOGCONFIG(TAG,
" Model: 7.5in-bc");
4445 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
4446 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
4447 LOG_UPDATE_INTERVAL(
this);
4543 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
4544 ESP_LOGCONFIG(TAG,
" Model: 7.5in-HD-b");
4546 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
4547 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
4548 LOG_UPDATE_INTERVAL(
this);
4551static const uint8_t LUT_SIZE_TTGO_DKE_PART = 153;
4553static const uint8_t PART_UPDATE_LUT_TTGO_DKE[LUT_SIZE_TTGO_DKE_PART] = {
4554 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4555 0x0, 0x0, 0x0, 0x0, 0x40, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0,
4556 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4557 0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4558 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4559 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4560 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
4561 0x0, 0x0, 0x0, 0x0, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
4571 ESP_LOGI(TAG,
"Performing partial e-paper update.");
4573 ESP_LOGI(TAG,
"Performing full e-paper update.");
4610 this->
write_array(PART_UPDATE_LUT_TTGO_DKE,
sizeof(PART_UPDATE_LUT_TTGO_DKE));
4662 ESP_LOGI(TAG,
"Completed e-paper update.");
4669 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
4670 ESP_LOGCONFIG(TAG,
" Model: 2.13inDKE");
4671 LOG_PIN(
" CS Pin: ", this->
cs_);
4673 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
4674 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
4675 LOG_UPDATE_INTERVAL(
this);
4713 this->
data(0 & 0xFF);
4714 this->
data((0 >> 8) & 0x03);
4719 this->
data(0 & 0xFF);
4720 this->
data((0 >> 8) & 0x03);
4733 this->
data(0 & 0xFF);
4734 this->
data((0 >> 8) & 0x03);
4737 this->
data(0 & 0xFF);
4738 this->
data((0 >> 8) & 0x03);
4757 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
4758 ESP_LOGCONFIG(TAG,
" Model: 13.3inK");
4760 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
4761 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
4762 LOG_UPDATE_INTERVAL(
this);
void feed_wdt(uint32_t time=0)
void status_set_warning(const char *message=nullptr)
void status_clear_warning()
virtual void digital_write(bool value)=0
virtual bool digital_read()=0
An STL allocator that uses SPI or internal RAM.
void deallocate(T *p, size_t n)
int get_width() override
Get the width of the image in pixels with rotation applied.
void init_internal_(uint32_t buffer_length)
int get_height() override
Get the height of the image in pixels with rotation applied.
virtual void clear()
Clear the entire screen by filling it with OFF pixels.
virtual void fill(Color color)
Fill the entire screen with the given color.
virtual int get_width_internal()=0
virtual int get_height_internal()=0
Rect get_clipping() const
Get the current the clipping rectangle.
void filled_rectangle(int x1, int y1, int width, int height, Color color=COLOR_ON)
Fill a rectangle with the top left point at [x1,y1] and the bottom right point at [x1+width,...
void spi_setup() override
void write_byte(uint8_t data)
void write_array(const uint8_t *data, size_t length)
void deep_sleep() override
int get_height_internal() override
int get_width_internal() override
void initialize() override
void dump_config() override
void set_full_update_every(uint32_t full_update_every)
void deep_sleep() override
int get_height_internal() override
void write_lut_(const uint8_t *lut, uint8_t size)
int get_width_internal() override
void dump_config() override
void initialize() override
int get_height_internal() override
void dump_config() override
int get_width_internal() override
void initialize() override
void set_full_update_every(uint32_t full_update_every)
int get_height_internal() override
uint32_t idle_timeout_() override
uint32_t full_update_every_
void dump_config() override
void initialize() override
void deep_sleep() override
int get_width_internal() override
int get_width_internal() override
void dump_config() override
void initialize() override
uint32_t idle_timeout_() override
void deep_sleep() override
void set_full_update_every(uint32_t full_update_every)
int get_height_internal() override
void initialize() override
uint32_t idle_timeout_() override
void dump_config() override
int get_height_internal() override
int get_width_internal() override
int get_height_internal() override
int get_width_internal() override
void deep_sleep() override
void initialize() override
void dump_config() override
uint32_t full_update_every_
int get_width_internal() override
void set_full_update_every(uint32_t full_update_every)
uint32_t idle_timeout_() override
int get_height_internal() override
void dump_config() override
void initialize() override
int get_width_internal() override
void deep_sleep() override
void dump_config() override
void initialize() override
int get_height_internal() override
int get_width_internal() override
void dump_config() override
int get_height_internal() override
void initialize() override
void initialize() override
void dump_config() override
int get_width_internal() override
int get_height_internal() override
int get_width_internal() override
void dump_config() override
int get_height_internal() override
void initialize() override
int get_height_internal() override
void initialize() override
void dump_config() override
int get_width_internal() override
void dump_config() override
int get_height_internal() override
void initialize() override
int get_width_internal() override
int get_height_internal() override
void dump_config() override
int get_width_internal() override
void initialize() override
void dump_config() override
int get_height_internal() override
int get_width_internal() override
void initialize() override
void set_full_update_every(uint32_t full_update_every)
uint32_t full_update_every_
int get_width_controller() override
int get_height_internal() override
void initialize() override
uint32_t full_update_every_
WaveshareEPaper2P9InV2R2()
int get_width_internal() override
void write_lut_(const uint8_t *lut, uint8_t size)
void dump_config() override
void set_full_update_every(uint32_t full_update_every)
void deep_sleep() override
int get_width_internal() override
void dump_config() override
void initialize() override
int get_height_internal() override
void initialize() override
void dump_config() override
int get_height_internal() override
int get_width_internal() override
void initialize() override
int get_height_internal() override
int get_width_internal() override
void dump_config() override
int get_width_internal() override
void initialize() override
void dump_config() override
uint32_t idle_timeout_() override
int get_height_internal() override
bool deep_sleep_between_updates_
bool wait_until_(WaitForState state)
int get_height_internal() override
int get_width_internal() override
void initialize() override
void dump_config() override
int get_width_internal() override
int get_height_internal() override
void initialize() override
void dump_config() override
void init_internal_7c_(uint32_t buffer_length)
void draw_absolute_pixel_internal(int x, int y, Color color) override
uint8_t * buffers_[NUM_BUFFERS]
uint8_t color_to_hex(Color color)
void fill(Color color) override
uint32_t get_buffer_length_() override
static const int NUM_BUFFERS
void initialize() override
bool deep_sleep_between_updates_
int get_height_internal() override
void dump_config() override
uint32_t idle_timeout_() override
int get_width_internal() override
void dump_config() override
void initialize() override
int get_height_internal() override
int get_width_internal() override
void dump_config() override
void deep_sleep() override
void initialize() override
int get_height_internal() override
int get_width_internal() override
void deep_sleep() override
void initialize() override
void dump_config() override
int get_width_internal() override
int get_height_internal() override
void deep_sleep() override
int get_height_internal() override
void dump_config() override
void initialize() override
int get_width_internal() override
void dump_config() override
int get_height_internal() override
void initialize() override
int get_width_internal() override
void dump_config() override
int get_height_internal() override
void initialize() override
int get_width_internal() override
int get_width_internal() override
uint32_t idle_timeout_() override
int get_height_internal() override
void initialize() override
void dump_config() override
void dump_config() override
int get_width_internal() override
int get_height_internal() override
void initialize() override
uint32_t idle_timeout_() override
void set_full_update_every(uint32_t full_update_every)
uint32_t full_update_every_
void dump_config() override
void initialize() override
uint32_t get_buffer_length_() override
void draw_absolute_pixel_internal(int x, int y, Color color) override
void fill(Color color) override
float get_setup_priority() const override
void command(uint8_t value)
virtual void initialize()=0
void on_safe_shutdown() override
void cmd_data(const uint8_t *data, size_t length)
virtual uint32_t idle_timeout_()
virtual int get_width_controller()
virtual void deep_sleep()=0
virtual uint32_t get_buffer_length_()=0
uint32_t get_buffer_length_() override
void fill(Color color) override
void draw_absolute_pixel_internal(int x, int y, Color color) override
int get_width_controller() override
void set_full_update_every(uint32_t full_update_every)
WaveshareEPaperTypeA(WaveshareEPaperTypeAModel model)
void write_lut_(const uint8_t *lut, uint8_t size)
uint32_t idle_timeout_() override
void dump_config() override
bool deep_sleep_between_updates_
int get_height_internal() override
void initialize() override
void deep_sleep() override
WaveshareEPaperTypeAModel model_
uint32_t full_update_every_
int get_width_internal() override
const float PROCESSOR
For components that use data from sensors like displays.
WaveshareEPaperTypeAModel
@ WAVESHARE_EPAPER_2_9_IN
@ WAVESHARE_EPAPER_2_13_IN_V2
@ TTGO_EPAPER_2_13_IN_B73
@ TTGO_EPAPER_2_13_IN_B74
@ WAVESHARE_EPAPER_2_13_IN
@ WAVESHARE_EPAPER_2_9_IN_V2
@ WAVESHARE_EPAPER_1_54_IN
@ WAVESHARE_EPAPER_1_54_IN_V2
Providing packet encoding functions for exchanging data with a remote host.
void IRAM_ATTR HOT delayMicroseconds(uint32_t us)
void IRAM_ATTR HOT delay(uint32_t ms)
uint32_t IRAM_ATTR HOT millis()
Application App
Global storage of Application pointer - only one Application can exist.
bool is_on() ESPHOME_ALWAYS_INLINE