11using namespace display;
28static constexpr uint8_t MAX_TRANSFER_TIME = 10;
29static constexpr uint8_t DELAY_FLAG = 0xFF;
32 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW, spi::CLOCK_PHASE_LEADING,
33 spi::DATA_RATE_2MHZ> {
35 EPaperBase(
const char *name, uint16_t width, uint16_t height,
const uint8_t *init_sequence,
51 void data(uint8_t value);
57 void setup()
override;
123#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE
virtual void power_off()=0
Power the display off.
void command(uint8_t value)
const uint8_t * init_sequence_
void process_state_()
Process the state machine.
virtual void deep_sleep()=0
Place the display into deep sleep.
DisplayType display_type_
void on_safe_shutdown() override
int get_height_internal() override
uint32_t waiting_for_idle_start_
void loop() override
Called during the loop task.
void set_dc_pin(GPIOPin *dc_pin)
void dump_config() override
void set_reset_pin(GPIOPin *reset)
virtual bool transfer_data()=0
Methods that must be implemented by concrete classes to control the display.
split_buffer::SplitBuffer buffer_
void cmd_data(uint8_t command, const uint8_t *ptr, size_t length)
virtual int get_width_controller()
void set_state_(EPaperState state, uint16_t delay=0)
const char * epaper_state_to_string_()
virtual void power_on()=0
Power the display on.
void set_reset_duration(uint32_t reset_duration)
uint32_t transfer_start_time_
DisplayType get_display_type() override
void wait_for_idle_(bool should_wait)
size_t current_data_index_
uint32_t waiting_for_idle_last_print_
size_t init_sequence_length_
float get_setup_priority() const override
bool init_buffer_(size_t buffer_length)
void set_busy_pin(GPIOPin *busy)
virtual void refresh_screen()=0
Refresh the screen after data transfer.
int get_width_internal() override
EPaperBase(const char *name, uint16_t width, uint16_t height, const uint8_t *init_sequence, size_t init_sequence_length, DisplayType display_type=DISPLAY_TYPE_BINARY)
The SPIDevice is what components using the SPI will create.
A SplitBuffer allocates a large memory buffer potentially as multiple smaller buffers to facilitate a...
void IRAM_ATTR HOT delay(uint32_t ms)