ESPHome 2026.11.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, 2),
31 fast_update_(fast_update),
32 fast_update_length_(fast_update_length) {}
33
34 void fill(Color color) override;
35
36 protected:
38 void draw_pixel_at(int x, int y, Color color) override;
39
44 bool reset() override;
45
47 bool initialise(bool partial) override;
48
50 bool transfer_data() override;
51
55 void power_on() override {}
56
62 void refresh_screen([[maybe_unused]] bool partial) override;
63
69 void power_off() override;
70
75 void deep_sleep() override;
76
82 void write_fastinit_();
83
89
91 static constexpr uint8_t CMD_POWEROFF = 0x02;
92 static constexpr uint8_t CMD_DEEPSLEEP = 0x07;
93 static constexpr uint8_t CMD_TRANSFER = 0x10;
94 static constexpr uint8_t CMD_REFRESH = 0x12;
98 enum class FSMState : uint8_t {
99 NONE = 0,
100
101 /* Reset state steps */
105
106 /* Init state steps */
109 };
110
115 static constexpr uint16_t SLEEP_MS_RESET0 = 200;
116
126 static constexpr uint16_t SLEEP_MS_RESET1 = 2;
127
132 static constexpr uint16_t SLEEP_MS_RESET2 = 200;
133
134 // properties initialised in the constructor
135 const uint8_t *const fast_update_{};
136 const uint16_t fast_update_length_{};
137
140};
141
142} // 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