8 namespace waveshare_epaper {
10 static const char *
const TAG =
"waveshare_epaper";
12 static const uint8_t LUT_SIZE_WAVESHARE = 30;
14 static const uint8_t FULL_UPDATE_LUT[LUT_SIZE_WAVESHARE] = {0x02, 0x02, 0x01, 0x11, 0x12, 0x12, 0x22, 0x22, 0x66, 0x69,
15 0x69, 0x59, 0x58, 0x99, 0x99, 0x88, 0x00, 0x00, 0x00, 0x00,
16 0xF8, 0xB4, 0x13, 0x51, 0x35, 0x51, 0x51, 0x19, 0x01, 0x00};
18 static const uint8_t PARTIAL_UPDATE_LUT[LUT_SIZE_WAVESHARE] = {
19 0x10, 0x18, 0x18, 0x08, 0x18, 0x18, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
20 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x14, 0x44, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
22 static const uint8_t LUT_SIZE_TTGO = 70;
24 static const uint8_t FULL_UPDATE_LUT_TTGO[LUT_SIZE_TTGO] = {
25 0x80, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00,
26 0x10, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00,
27 0x80, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00,
28 0x10, 0x60, 0x20, 0x00, 0x00, 0x00, 0x00,
29 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
30 0x03, 0x03, 0x00, 0x00, 0x02,
31 0x09, 0x09, 0x00, 0x00, 0x02,
32 0x03, 0x03, 0x00, 0x00, 0x02,
33 0x00, 0x00, 0x00, 0x00, 0x00,
34 0x00, 0x00, 0x00, 0x00, 0x00,
35 0x00, 0x00, 0x00, 0x00, 0x00,
36 0x00, 0x00, 0x00, 0x00, 0x00,
39 static const uint8_t PARTIAL_UPDATE_LUT_TTGO[LUT_SIZE_TTGO] = {
40 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
41 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
42 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
43 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
44 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
45 0x0A, 0x00, 0x00, 0x00, 0x00,
46 0x00, 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,
54 static const uint8_t LUT_SIZE_TTGO_B73 = 100;
56 static const uint8_t FULL_UPDATE_LUT_TTGO_B73[LUT_SIZE_TTGO_B73] = {
57 0xA0, 0x90, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x90, 0xA0, 0x00, 0x00, 0x00, 0x00,
58 0x00, 0x00, 0x00, 0xA0, 0x90, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x90, 0xA0, 0x00,
59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
61 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x03, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00,
62 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
63 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66 static const uint8_t PARTIAL_UPDATE_LUT_TTGO_B73[LUT_SIZE_TTGO_B73] = {
67 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
68 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
69 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
71 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
72 0x00, 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,
76 static const uint8_t LUT_SIZE_TTGO_B1 = 29;
78 static const uint8_t FULL_UPDATE_LUT_TTGO_B1[LUT_SIZE_TTGO_B1] = {
79 0x22, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
80 0x00, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x01, 0x00, 0x00, 0x00, 0x00};
82 static const uint8_t PARTIAL_UPDATE_LUT_TTGO_B1[LUT_SIZE_TTGO_B1] = {
83 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
84 0x00, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
117 const uint32_t start =
millis();
120 ESP_LOGE(TAG,
"Timeout while displaying image!");
133 const uint8_t
fill = color.
is_on() ? 0x00 : 0xFF;
142 const uint8_t subpos = x & 0x07;
144 if (!color.
is_on()) {
145 this->
buffer_[pos] |= 0x80 >> subpos;
147 this->
buffer_[pos] &= ~(0x80 >> subpos);
207 switch (this->model_) {
224 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
225 switch (this->model_) {
227 ESP_LOGCONFIG(TAG,
" Model: 1.54in");
230 ESP_LOGCONFIG(TAG,
" Model: 1.54inV2");
233 ESP_LOGCONFIG(TAG,
" Model: 2.13in");
236 ESP_LOGCONFIG(TAG,
" Model: 2.13in (TTGO)");
239 ESP_LOGCONFIG(TAG,
" Model: 2.13in (TTGO B73)");
242 ESP_LOGCONFIG(TAG,
" Model: 2.13in (TTGO B74)");
245 ESP_LOGCONFIG(TAG,
" Model: 2.13in (TTGO B1)");
248 ESP_LOGCONFIG(TAG,
" Model: 2.9in");
251 ESP_LOGCONFIG(TAG,
" Model: 2.9inV2");
254 ESP_LOGCONFIG(TAG,
" Full Update Every: %" PRIu32, this->full_update_every_);
256 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
258 LOG_UPDATE_INTERVAL(
this);
261 bool full_update = this->at_update_ == 0;
262 bool prev_full_update = this->at_update_ == 1;
269 if (this->full_update_every_ >= 1) {
270 if (full_update != prev_full_update) {
271 switch (this->model_) {
273 this->write_lut_(full_update ? FULL_UPDATE_LUT_TTGO : PARTIAL_UPDATE_LUT_TTGO, LUT_SIZE_TTGO);
276 this->write_lut_(full_update ? FULL_UPDATE_LUT_TTGO_B73 : PARTIAL_UPDATE_LUT_TTGO_B73, LUT_SIZE_TTGO_B73);
282 this->write_lut_(full_update ? FULL_UPDATE_LUT_TTGO_B1 : PARTIAL_UPDATE_LUT_TTGO_B1, LUT_SIZE_TTGO_B1);
285 this->write_lut_(full_update ? FULL_UPDATE_LUT : PARTIAL_UPDATE_LUT, LUT_SIZE_WAVESHARE);
288 this->at_update_ = (this->at_update_ + 1) % this->full_update_every_;
292 switch (this->model_) {
317 this->
data(full_update ? 0x05 : 0x80);
349 switch (this->model_) {
353 for (
int j = 0; j < wb; j++) {
367 switch (this->model_) {
371 this->
data(full_update ? 0xF7 : 0xFF);
389 switch (this->model_) {
407 switch (this->model_) {
419 switch (this->model_) {
438 for (uint8_t i = 0; i < size; i++)
462 static const uint8_t LUT_VCOM_DC_2_7[44] = {
463 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x00, 0x32, 0x32, 0x00, 0x00, 0x02, 0x00,
464 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
465 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
468 static const uint8_t LUT_WHITE_TO_WHITE_2_7[42] = {
469 0x50, 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x60, 0x32, 0x32, 0x00, 0x00, 0x02, 0xA0, 0x0F,
470 0x0F, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
471 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
474 static const uint8_t LUT_BLACK_TO_WHITE_2_7[42] = {
475 0x50, 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x60, 0x32, 0x32, 0x00, 0x00, 0x02, 0xA0, 0x0F,
476 0x0F, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
477 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
480 static const uint8_t LUT_WHITE_TO_BLACK_2_7[] = {
481 0xA0, 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x60, 0x32, 0x32, 0x00, 0x00, 0x02, 0x50, 0x0F,
482 0x0F, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
483 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
486 static const uint8_t LUT_BLACK_TO_BLACK_2_7[42] = {
487 0xA0, 0x0F, 0x0F, 0x00, 0x00, 0x05, 0x60, 0x32, 0x32, 0x00, 0x00, 0x02, 0x50, 0x0F,
488 0x0F, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
489 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
552 for (uint8_t i : LUT_VCOM_DC_2_7)
557 for (uint8_t i : LUT_WHITE_TO_WHITE_2_7)
561 for (uint8_t i : LUT_BLACK_TO_WHITE_2_7)
565 for (uint8_t i : LUT_WHITE_TO_BLACK_2_7)
569 for (uint8_t i : LUT_BLACK_TO_BLACK_2_7)
578 for (uint32_t i = 0; i < buf_len; i++) {
586 for (uint32_t i = 0; i < buf_len; i++) {
596 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
597 ESP_LOGCONFIG(TAG,
" Model: 2.7in");
599 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
601 LOG_UPDATE_INTERVAL(
this);
675 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
676 ESP_LOGCONFIG(TAG,
" Model: 2.9in (B)");
678 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
680 LOG_UPDATE_INTERVAL(
this);
726 this->
data(0b10011111);
759 LOG_DISPLAY(
"",
"Waveshare E-Paper (Good Display)",
this);
760 ESP_LOGCONFIG(TAG,
" Model: 2.9in Greyscale GDEY029T94");
762 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
764 LOG_UPDATE_INTERVAL(
this);
784 if (this->lastbuff_ !=
nullptr) {
790 void GDEW0154M09::reset_() {
800 void GDEW0154M09::init_internal_() {
811 const uint8_t panel_setting_1 = 0b11011111;
818 const uint8_t panel_setting_2 = 0b01110;
820 const uint8_t wf_t0154_cz_b3_list[] = {
822 CMD_PSR_PANEL_SETTING, 2, panel_setting_1, panel_setting_2,
823 CMD_UNDOCUMENTED_0x4D, 1, 0x55,
824 CMD_UNDOCUMENTED_0xAA, 1, 0x0f,
825 CMD_UNDOCUMENTED_0xE9, 1, 0x02,
826 CMD_UNDOCUMENTED_0xB6, 1, 0x11,
827 CMD_UNDOCUMENTED_0xF3, 1, 0x0a,
828 CMD_TRES_RESOLUTION_SETTING, 3, 0xc8, 0x00, 0xc8,
829 CMD_TCON_TCONSETTING, 1, 0x00,
830 CMD_CDI_VCOM_DATA_INTERVAL, 1, 0xd7,
831 CMD_PWS_POWER_SAVING, 1, 0x00,
836 this->write_init_list_(wf_t0154_cz_b3_list);
841 void GDEW0154M09::write_init_list_(
const uint8_t *list) {
842 uint8_t list_limit = list[0];
843 uint8_t *start_ptr = ((uint8_t *) list + 1);
844 for (uint8_t i = 0; i < list_limit; i++) {
845 this->
command(*(start_ptr + 0));
846 for (uint8_t dnum = 0; dnum < *(start_ptr + 1); dnum++) {
847 this->
data(*(start_ptr + 2 + dnum));
849 start_ptr += (*(start_ptr + 1) + 2);
853 void GDEW0154M09::clear_() {
855 for (uint8_t j = 0; j < 2; j++) {
856 this->
command(CMD_DTM1_DATA_START_TRANS);
857 for (
int count = 0; count < pixsize; count++) {
860 this->
command(CMD_DTM2_DATA_START_TRANS2);
861 for (
int count = 0; count < pixsize; count++) {
864 this->
command(CMD_DISPLAY_REFRESH);
873 this->
command(CMD_DTM1_DATA_START_TRANS);
877 this->
command(CMD_DTM2_DATA_START_TRANS2);
881 this->
command(CMD_DISPLAY_REFRESH);
889 this->
command(CMD_POF_POWER_OFF);
892 this->
command(CMD_DSLP_DEEP_SLEEP);
893 this->
data(DATA_DSLP_DEEP_SLEEP);
899 LOG_DISPLAY(
"",
"M5Stack CoreInk E-Paper (Good Display)",
this);
900 ESP_LOGCONFIG(TAG,
" Model: 1.54in Greyscale GDEW0154M09");
902 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
904 LOG_UPDATE_INTERVAL(
this);
907 static const uint8_t LUT_VCOM_DC_4_2[] = {
908 0x00, 0x17, 0x00, 0x00, 0x00, 0x02, 0x00, 0x17, 0x17, 0x00, 0x00, 0x02, 0x00, 0x0A, 0x01,
909 0x00, 0x00, 0x01, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
910 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
912 static const uint8_t LUT_WHITE_TO_WHITE_4_2[] = {
913 0x40, 0x17, 0x00, 0x00, 0x00, 0x02, 0x90, 0x17, 0x17, 0x00, 0x00, 0x02, 0x40, 0x0A,
914 0x01, 0x00, 0x00, 0x01, 0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
915 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
917 static const uint8_t LUT_BLACK_TO_WHITE_4_2[] = {
918 0x40, 0x17, 0x00, 0x00, 0x00, 0x02, 0x90, 0x17, 0x17, 0x00, 0x00, 0x02, 0x40, 0x0A,
919 0x01, 0x00, 0x00, 0x01, 0xA0, 0x0E, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
920 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
923 static const uint8_t LUT_BLACK_TO_BLACK_4_2[] = {
924 0x80, 0x17, 0x00, 0x00, 0x00, 0x02, 0x90, 0x17, 0x17, 0x00, 0x00, 0x02, 0x80, 0x0A,
925 0x01, 0x00, 0x00, 0x01, 0x50, 0x0E, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
926 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
929 static const uint8_t LUT_WHITE_TO_BLACK_4_2[] = {
930 0x80, 0x17, 0x00, 0x00, 0x00, 0x02, 0x90, 0x17, 0x17, 0x00, 0x00, 0x02, 0x80, 0x0A,
931 0x01, 0x00, 0x00, 0x01, 0x50, 0x0E, 0x0E, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
932 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
967 for (uint8_t i : LUT_VCOM_DC_4_2)
971 for (uint8_t i : LUT_WHITE_TO_WHITE_4_2)
975 for (uint8_t i : LUT_BLACK_TO_WHITE_4_2)
979 for (uint8_t i : LUT_WHITE_TO_BLACK_4_2)
983 for (uint8_t i : LUT_BLACK_TO_BLACK_4_2)
1021 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1022 ESP_LOGCONFIG(TAG,
" Model: 4.2in");
1024 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1025 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1026 LOG_UPDATE_INTERVAL(
this);
1077 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1078 ESP_LOGCONFIG(TAG,
" Model: 4.2in (B V2)");
1080 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1081 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1082 LOG_UPDATE_INTERVAL(
this);
1143 uint8_t temp1 = this->
buffer_[i];
1144 for (uint8_t j = 0; j < 8; j++) {
1174 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1175 ESP_LOGCONFIG(TAG,
" Model: 5.83in");
1177 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1178 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1179 LOG_UPDATE_INTERVAL(
this);
1255 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1256 ESP_LOGCONFIG(TAG,
" Model: 5.83inv2");
1258 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1259 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1260 LOG_UPDATE_INTERVAL(
this);
1324 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1325 ESP_LOGCONFIG(TAG,
" Model: 7.5in-bv2");
1327 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1328 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1329 LOG_UPDATE_INTERVAL(
this);
1337 const uint32_t start =
millis();
1341 ESP_LOGI(TAG,
"Timeout while displaying image!");
1407 uint8_t lut_vcom_7_i_n5_v2[] = {
1408 0x0, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0xF, 0x1, 0xF, 0x1, 0x2, 0x0, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
1409 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1412 uint8_t lut_ww_7_i_n5_v2[] = {
1413 0x10, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x20, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
1414 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1417 uint8_t lut_bw_7_i_n5_v2[] = {
1418 0x10, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x20, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
1419 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1422 uint8_t lut_wb_7_i_n5_v2[] = {
1423 0x80, 0xF, 0xF, 0x0, 0x0, 0x3, 0x84, 0xF, 0x1, 0xF, 0x1, 0x4, 0x40, 0xF, 0xF, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0,
1424 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1427 uint8_t lut_bb_7_i_n5_v2[] = {
1428 0x80, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x40, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
1429 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1434 for (count = 0; count < 42; count++)
1435 this->
data(lut_vcom_7_i_n5_v2[count]);
1438 for (count = 0; count < 42; count++)
1439 this->
data(lut_ww_7_i_n5_v2[count]);
1442 for (count = 0; count < 42; count++)
1443 this->
data(lut_bw_7_i_n5_v2[count]);
1446 for (count = 0; count < 42; count++)
1447 this->
data(lut_wb_7_i_n5_v2[count]);
1450 for (count = 0; count < 42; count++)
1451 this->
data(lut_bb_7_i_n5_v2[count]);
1454 for (uint32_t i = 0; i < 800 * 480 / 8; i++) {
1463 for (uint32_t i = 0; i < buf_len; i++) {
1474 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1475 ESP_LOGCONFIG(TAG,
" Model: 7.5in-bv3");
1477 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1478 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1479 LOG_UPDATE_INTERVAL(
this);
1529 uint8_t temp1 = this->
buffer_[i];
1530 for (uint8_t j = 0; j < 8; j++) {
1557 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1558 ESP_LOGCONFIG(TAG,
" Model: 7.5in");
1560 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1561 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1562 LOG_UPDATE_INTERVAL(
this);
1569 const uint32_t start =
millis();
1573 ESP_LOGE(TAG,
"Timeout while displaying image!");
1628 ESP_LOGI(TAG,
"Power on the display and hat");
1640 for (uint32_t i = 0; i < buf_len; i++) {
1652 ESP_LOGV(TAG,
"Before command(0x02) (>> power off)");
1655 ESP_LOGV(TAG,
"After command(0x02) (>> power off)");
1662 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1663 ESP_LOGCONFIG(TAG,
" Model: 7.5inV2rev2");
1665 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1666 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1667 LOG_UPDATE_INTERVAL(
this);
1676 const uint32_t start =
millis();
1680 ESP_LOGI(TAG,
"Timeout while displaying image!");
1746 uint8_t lut_vcom_7_i_n5_v2[] = {
1747 0x0, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0xF, 0x1, 0xF, 0x1, 0x2, 0x0, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
1748 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1751 uint8_t lut_ww_7_i_n5_v2[] = {
1752 0x10, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x20, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
1753 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1756 uint8_t lut_bw_7_i_n5_v2[] = {
1757 0x10, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x20, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
1758 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1761 uint8_t lut_wb_7_i_n5_v2[] = {
1762 0x80, 0xF, 0xF, 0x0, 0x0, 0x3, 0x84, 0xF, 0x1, 0xF, 0x1, 0x4, 0x40, 0xF, 0xF, 0x0, 0x0, 0x3, 0x0, 0x0, 0x0,
1763 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1766 uint8_t lut_bb_7_i_n5_v2[] = {
1767 0x80, 0xF, 0xF, 0x0, 0x0, 0x1, 0x84, 0xF, 0x1, 0xF, 0x1, 0x2, 0x40, 0xF, 0xF, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0,
1768 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
1773 for (count = 0; count < 42; count++)
1774 this->
data(lut_vcom_7_i_n5_v2[count]);
1777 for (count = 0; count < 42; count++)
1778 this->
data(lut_ww_7_i_n5_v2[count]);
1781 for (count = 0; count < 42; count++)
1782 this->
data(lut_bw_7_i_n5_v2[count]);
1785 for (count = 0; count < 42; count++)
1786 this->
data(lut_wb_7_i_n5_v2[count]);
1789 for (count = 0; count < 42; count++)
1790 this->
data(lut_bb_7_i_n5_v2[count]);
1794 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1795 ESP_LOGCONFIG(TAG,
" Model: 7.5inV2");
1797 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1798 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1799 LOG_UPDATE_INTERVAL(
this);
1861 uint8_t eight_pixels = this->
buffer_[i];
1863 for (uint8_t j = 0; j < 8; j += 2) {
1867 uint8_t left_nibble = (eight_pixels & 0x80) ? 0x30 : 0x00;
1869 uint8_t right_nibble = (eight_pixels & 0x80) ? 0x03 : 0x00;
1871 this->
write_byte(left_nibble | right_nibble);
1890 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1891 ESP_LOGCONFIG(TAG,
" Model: 7.5in-bc");
1893 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1894 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1895 LOG_UPDATE_INTERVAL(
this);
1991 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
1992 ESP_LOGCONFIG(TAG,
" Model: 7.5in-HD-b");
1994 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
1995 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
1996 LOG_UPDATE_INTERVAL(
this);
1999 static const uint8_t LUT_SIZE_TTGO_DKE_PART = 153;
2001 static const uint8_t PART_UPDATE_LUT_TTGO_DKE[LUT_SIZE_TTGO_DKE_PART] = {
2002 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
2003 0x0, 0x0, 0x0, 0x0, 0x40, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0,
2004 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
2005 0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
2006 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
2007 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
2008 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
2009 0x0, 0x0, 0x0, 0x0, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
2019 ESP_LOGI(TAG,
"Performing partial e-paper update.");
2021 ESP_LOGI(TAG,
"Performing full e-paper update.");
2057 for (uint8_t v : PART_UPDATE_LUT_TTGO_DKE)
2111 ESP_LOGI(TAG,
"Completed e-paper update.");
2118 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this);
2119 ESP_LOGCONFIG(TAG,
" Model: 2.13inDKE");
2121 LOG_PIN(
" DC Pin: ", this->
dc_pin_);
2122 LOG_PIN(
" Busy Pin: ", this->
busy_pin_);
2123 LOG_UPDATE_INTERVAL(
this);
void initialize() override
int get_width_internal() override
virtual void digital_write(bool value)=0
void dump_config() override
int get_height_internal() override
virtual uint32_t idle_timeout_()
void initialize() override
void dump_config() override
void deep_sleep() override
void dump_config() override
void dump_config() override
void dump_config() override
void write_lut_(const uint8_t *lut, uint8_t size)
void spi_setup() override
void dump_config() override
int get_width_internal() override
uint32_t idle_timeout_() override
void draw_absolute_pixel_internal(int x, int y, Color color) override
void initialize() override
int get_height_internal() override
void initialize() override
An STL allocator that uses SPI RAM.
int get_height_internal() override
void dump_config() override
void set_full_update_every(uint32_t full_update_every)
int get_width_internal() override
virtual int get_width_internal()=0
int get_width_internal() override
WaveshareEPaperTypeA(WaveshareEPaperTypeAModel model)
int get_width_internal() override
void write_byte(uint8_t data)
void fill(Color color) override
void command(uint8_t value)
uint32_t IRAM_ATTR HOT millis()
void initialize() override
uint32_t idle_timeout_() override
int get_width_internal() override
int get_width_internal() override
uint32_t idle_timeout_() override
void initialize() override
void init_internal_(uint32_t buffer_length)
int get_width_internal() override
virtual void deep_sleep()=0
virtual int get_width_controller()
int get_width_internal() override
void dump_config() override
void initialize() override
void initialize() override
void dump_config() override
int get_width_internal() override
void dump_config() override
WaveshareEPaperTypeAModel model_
void dump_config() override
void initialize() override
void on_safe_shutdown() override
int get_width_internal() override
int get_width_internal() override
WaveshareEPaperTypeAModel
void status_clear_warning()
void dump_config() override
void dump_config() override
void initialize() override
void deep_sleep() override
int get_height_internal() override
const float PROCESSOR
For components that use data from sensors like displays.
int get_height_internal() override
void dump_config() override
Application App
Global storage of Application pointer - only one Application can exist.
void status_set_warning()
void dump_config() override
void initialize() override
virtual bool digital_read()=0
void initialize() override
int get_height_internal() override
void initialize() override
void initialize() override
int get_height_internal() override
int get_height_internal() override
int get_width_internal() override
virtual int get_height_internal()=0
void write_array(const uint8_t *data, size_t length)
int get_width_internal() override
int get_height_internal() override
int get_height_internal() override
Implementation of SPI Controller mode.
int get_width_internal() override
void initialize() override
void initialize() override
uint32_t full_update_every_
void initialize() override
bool is_on() ALWAYS_INLINE
int get_height_internal() override
int get_width_controller() override
int get_height_internal() override
int get_height_internal() override
int get_height_internal() override
float get_setup_priority() const override
void dump_config() override
int get_height_internal() override
void set_full_update_every(uint32_t full_update_every)
int get_width_internal() override
int get_height_internal() override
uint32_t get_buffer_length_()
void dump_config() override
void IRAM_ATTR HOT delay(uint32_t ms)