ESPHome 2026.3.0-dev
Loading...
Searching...
No Matches
epaper_spi_jd79660.h
Go to the documentation of this file.
1#pragma once
2
3#include "epaper_spi.h"
4
5namespace esphome::epaper_spi {
6
26class EPaperJD79660 final : public EPaperBase {
27 public:
28 EPaperJD79660(const char *name, uint16_t width, uint16_t height, const uint8_t *init_sequence,
29 size_t init_sequence_length, const uint8_t *fast_update, uint16_t fast_update_length)
30 : EPaperBase(name, width, height, init_sequence, init_sequence_length, DISPLAY_TYPE_COLOR),
31 fast_update_(fast_update),
32 fast_update_length_(fast_update_length) {
33 this->row_width_ = (width + 3) / 4; // Fix base class calc (2bpp instead of 1bpp)
34 this->buffer_length_ = this->row_width_ * height;
35 }
36
37 void fill(Color color) override;
38
39 protected:
41 void draw_pixel_at(int x, int y, Color color) override;
42
47 bool reset() override;
48
50 bool initialise(bool partial) override;
51
53 bool transfer_data() override;
54
58 void power_on() override {}
59
65 void refresh_screen([[maybe_unused]] bool partial) override;
66
72 void power_off() override;
73
78 void deep_sleep() override;
79
85 void write_fastinit_();
86
92
94 static constexpr uint8_t CMD_POWEROFF = 0x02;
95 static constexpr uint8_t CMD_DEEPSLEEP = 0x07;
96 static constexpr uint8_t CMD_TRANSFER = 0x10;
97 static constexpr uint8_t CMD_REFRESH = 0x12;
101 enum class FSMState : uint8_t {
102 NONE = 0,
103
104 /* Reset state steps */
108
109 /* Init state steps */
112 };
113
118 static constexpr uint16_t SLEEP_MS_RESET0 = 200;
119
129 static constexpr uint16_t SLEEP_MS_RESET1 = 2;
130
135 static constexpr uint16_t SLEEP_MS_RESET2 = 200;
136
137 // properties initialised in the constructor
138 const uint8_t *const fast_update_{};
139 const uint16_t fast_update_length_{};
140
143};
144
145} // namespace esphome::epaper_spi
JD7966x IC driver implementation.
static constexpr uint16_t SLEEP_MS_RESET0
Wait time (millisec) for first reset phase: High.
void deep_sleep() override
Deepsleep: Must be used to avoid hardware wearout!
bool initialise(bool partial) override
Initialise (multistep sequence)
static constexpr uint8_t CMD_REFRESH
void write_fastinit_()
Internal: Send fast init sequence via undocumented vendor registers.
FSMState
State machine constants for step_.
@ NONE
Initial/default value: Unused.
bool transfer_data() override
Buffer transfer.
static constexpr uint8_t CMD_POWEROFF
void draw_pixel_at(int x, int y, Color color) override
Draw colored pixel into frame buffer.
static constexpr uint16_t SLEEP_MS_RESET2
Wait time (millisec) for third reset phase: High.
EPaperJD79660(const char *name, uint16_t width, uint16_t height, const uint8_t *init_sequence, size_t init_sequence_length, const uint8_t *fast_update, uint16_t fast_update_length)
bool transfer_buffer_chunks_()
Internal: Send raw buffer in chunks.
void power_on() override
Power on: Already part of init sequence (likely needed there before transferring buffers).
static constexpr uint8_t CMD_DEEPSLEEP
static constexpr uint16_t SLEEP_MS_RESET1
Wait time (millisec) for second reset phase: Low.
void refresh_screen(bool partial) override
Refresh screen.
static constexpr uint8_t CMD_TRANSFER
FSMState step_
Counter for tracking substeps within FSM state.
bool reset() override
Reset (multistep sequence)
uint16_t x
Definition tt21100.cpp:5
uint16_t y
Definition tt21100.cpp:6