8 namespace waveshare_epaper {
11 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
12 spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_2MHZ> {
21 void data(uint8_t value);
30 void setup()
override;
88 uint8_t color_to_hex(
Color color);
96 void setup()
override;
97 void init_internal_7c_(uint32_t buffer_length);
99 static const int NUM_BUFFERS = 10;
100 uint8_t *buffers_[NUM_BUFFERS];
127 switch (this->model_) {
150 void set_full_update_every(uint32_t full_update_every);
153 void write_lut_(
const uint8_t *lut, uint8_t size);
155 void init_display_();
163 uint32_t full_update_every_{30};
164 uint32_t at_update_{0};
168 bool deep_sleep_between_updates_{
false};
273 void set_full_update_every(uint32_t full_update_every);
276 void init_display_();
278 void init_partial_();
279 void write_lut_(
const uint8_t *lut, uint8_t size);
287 uint32_t full_update_every_{30};
288 uint32_t at_update_{0};
289 bool deep_sleep_between_updates_{
false};
290 bool power_is_on_{
false};
291 bool is_deep_sleep_{
false};
292 uint8_t *old_buffer_{
nullptr};
342 static const uint8_t CMD_DTM1_DATA_START_TRANS = 0x10;
343 static const uint8_t CMD_DTM2_DATA_START_TRANS2 = 0x13;
344 static const uint8_t CMD_DISPLAY_REFRESH = 0x12;
345 static const uint8_t CMD_AUTO_SEQ = 0x17;
346 static const uint8_t DATA_AUTO_PON_DSR_POF_DSLP = 0xA7;
347 static const uint8_t CMD_PSR_PANEL_SETTING = 0x00;
348 static const uint8_t CMD_UNDOCUMENTED_0x4D = 0x4D;
349 static const uint8_t CMD_UNDOCUMENTED_0xAA = 0xaa;
350 static const uint8_t CMD_UNDOCUMENTED_0xE9 = 0xe9;
351 static const uint8_t CMD_UNDOCUMENTED_0xB6 = 0xb6;
352 static const uint8_t CMD_UNDOCUMENTED_0xF3 = 0xf3;
353 static const uint8_t CMD_TRES_RESOLUTION_SETTING = 0x61;
354 static const uint8_t CMD_TCON_TCONSETTING = 0x60;
355 static const uint8_t CMD_CDI_VCOM_DATA_INTERVAL = 0x50;
356 static const uint8_t CMD_POF_POWER_OFF = 0x02;
357 static const uint8_t CMD_DSLP_DEEP_SLEEP = 0x07;
358 static const uint8_t DATA_DSLP_DEEP_SLEEP = 0xA5;
359 static const uint8_t CMD_PWS_POWER_SAVING = 0xe3;
360 static const uint8_t CMD_PON_POWER_ON = 0x04;
361 static const uint8_t CMD_PTL_PARTIAL_WINDOW = 0x90;
363 uint8_t *lastbuff_ =
nullptr;
366 void write_init_list_(
const uint8_t *list);
422 void set_full_update_every(uint32_t full_update_every);
425 void write_lut_(
const uint8_t *lut, uint8_t size);
433 uint32_t full_update_every_{30};
434 uint32_t at_update_{0};
454 void set_full_update_every(uint32_t full_update_every);
457 uint32_t full_update_every_{30};
458 uint32_t at_update_{0};
504 void set_full_update_every(uint32_t full_update_every);
507 uint32_t full_update_every_{30};
508 uint32_t at_update_{0};
518 void init_display_();
705 bool deep_sleep_between_updates_{
true};
800 void init_display_();
838 void init_display_();
929 void set_full_update_every(uint32_t full_update_every);
938 uint32_t full_update_every_{30};
939 uint32_t at_update_{0};
944 void turn_on_display_();
982 void set_full_update_every(uint32_t full_update_every);
991 uint32_t full_update_every_{30};
992 uint32_t at_update_{0};
1008 void set_full_update_every(uint32_t full_update_every);
1010 void setup()
override;
1019 void write_buffer_(uint8_t
cmd,
int top,
int bottom);
1020 void set_window_(
int t,
int b);
1022 void partial_update_();
1023 void full_update_();
1025 uint32_t full_update_every_{30};
1026 uint32_t at_update_{0};
1027 bool is_busy_{
false};
1028 void write_lut_(
const uint8_t *lut);
virtual void digital_write(bool value)=0
void set_reset_duration(uint32_t reset_duration)
void on_safe_shutdown() override
void deep_sleep() override
virtual void draw_absolute_pixel_internal(int x, int y, Color color)=0
void deep_sleep() override
float get_setup_priority() const override
virtual void initialize()=0
void deep_sleep() override
void deep_sleep() override
void deep_sleep() override
void deep_sleep() override
void deep_sleep() override
void set_reset_pin(GPIOPin *reset)
void deep_sleep() override
display::DisplayType get_display_type() override
void deep_sleep() override
virtual void fill(Color color)
Fill the entire screen with the given color.
void deep_sleep() override
virtual void dump_config()
virtual int get_width_controller()
void deep_sleep() override
WaveshareEPaperTypeBModel
void init_internal_(uint32_t buffer_length)
display::DisplayType get_display_type() override
void deep_sleep() override
The SPIDevice is what components using the SPI will create.
virtual int get_height_internal()=0
void deep_sleep() override
WaveshareEPaperTypeAModel model_
void set_dc_pin(GPIOPin *dc_pin)
void deep_sleep() override
virtual uint32_t get_buffer_length_()=0
WaveshareEPaperTypeAModel
virtual int get_width_internal()=0
void deep_sleep() override
void deep_sleep() override
void deep_sleep() override
void deep_sleep() override
void deep_sleep() override
virtual void deep_sleep()=0
void deep_sleep() override
void deep_sleep() override
void deep_sleep() override
virtual uint32_t idle_timeout_()
display::DisplayType get_display_type() override
Implementation of SPI Controller mode.
void command(uint8_t value)
void deep_sleep() override
void deep_sleep() override
void deep_sleep() override
void deep_sleep() override
void deep_sleep() override
void set_busy_pin(GPIOPin *busy)
void deep_sleep() override
void cmd_data(const uint8_t *data, size_t length)
void deep_sleep() override
void IRAM_ATTR HOT delay(uint32_t ms)