6namespace waveshare_epaper {
8static const char *
const TAG =
"waveshare_2.13v3";
10static const uint8_t PARTIAL_LUT[] = {
12 0x0, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
13 0x0, 0x0, 0x0, 0x0, 0x40, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x0, 0x0,
14 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
15 0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
16 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
17 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
18 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
19 0x0, 0x0, 0x0, 0x0, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
22static const uint8_t FULL_LUT[] = {
24 0x80, 0x4A, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x4A, 0x80, 0x0, 0x0, 0x0, 0x0, 0x0,
25 0x0, 0x0, 0x0, 0x0, 0x80, 0x4A, 0x40, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x40, 0x4A, 0x80, 0x0,
26 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
27 0xF, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xF, 0x0, 0x0, 0xF, 0x0, 0x0, 0x2, 0xF, 0x0, 0x0, 0x0, 0x0, 0x0,
28 0x0, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
29 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
30 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
31 0x0, 0x0, 0x0, 0x0, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x0, 0x0, 0x0,
34static const uint8_t SW_RESET = 0x12;
35static const uint8_t ACTIVATE = 0x20;
36static const uint8_t WRITE_BUFFER = 0x24;
37static const uint8_t WRITE_BASE = 0x26;
39static const uint8_t DRV_OUT_CTL[] = {0x01, 0x27, 0x01, 0x00};
40static const uint8_t GATEV[] = {0x03, 0x17};
41static const uint8_t SRCV[] = {0x04, 0x41, 0x0C, 0x32};
42static const uint8_t SLEEP[] = {0x10, 0x01};
43static const uint8_t DATA_ENTRY[] = {0x11, 0x03};
44static const uint8_t TEMP_SENS[] = {0x18, 0x80};
45static const uint8_t DISPLAY_UPDATE[] = {0x21, 0x00, 0x80};
46static const uint8_t UPSEQ[] = {0x22, 0xC0};
47static const uint8_t ON_FULL[] = {0x22, 0xC7};
48static const uint8_t ON_PARTIAL[] = {0x22, 0x0F};
49static const uint8_t VCOM[] = {0x2C, 0x36};
50static const uint8_t CMD5[] = {0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00};
51static const uint8_t BORDER_PART[] = {0x3C, 0x80};
52static const uint8_t BORDER_FULL[] = {0x3C, 0x05};
53static const uint8_t CMD1[] = {0x3F, 0x22};
54static const uint8_t RAM_X_START[] = {0x44, 0x00, 121 / 8};
55static const uint8_t RAM_Y_START[] = {0x45, 0x00, 0x00, 250 - 1, 0};
56static const uint8_t RAM_X_POS[] = {0x4E, 0x00};
58#define SEND(x) this->cmd_data(x, sizeof(x))
62 this->
cmd_data(lut,
sizeof(PARTIAL_LUT));
108 SEND(DISPLAY_UPDATE);
122 buffer[1] = (uint8_t) t;
123 buffer[2] = (uint8_t) (t >> 8);
148 ESP_LOGI(TAG,
"Performing full e-paper update.");
178 LOG_DISPLAY(
"",
"Waveshare E-Paper",
this)
179 ESP_LOGCONFIG(TAG,
" Model: 2.13inV3");
180 LOG_PIN(
" CS Pin: ", this->
cs_)
182 LOG_PIN(
" DC Pin: ", this->
dc_pin_)
184 LOG_UPDATE_INTERVAL(
this)