12static constexpr uint8_t CMD_PSR = 0x00;
13static constexpr uint8_t CMD_PWR = 0x01;
14static constexpr uint8_t CMD_BTST = 0x06;
15static constexpr uint8_t CMD_LUT_VCOM = 0x20;
16static constexpr uint8_t CMD_PLL = 0x30;
17static constexpr uint8_t CMD_VDCS = 0x82;
19static constexpr uint16_t BUSY_ASSERT_MS = 100;
23static constexpr size_t LUT_VCOM_SIZE = 44;
24static constexpr size_t LUT_SIZE = 42;
25static constexpr size_t LUT_COUNT = 5;
26static constexpr uint8_t LUT_PARTIAL[LUT_COUNT][LUT_VCOM_SIZE]
PROGMEM = {
27 {0x00, 0x20, 0x01, 0x00, 0x00, 0x01},
28 {0x00, 0x20, 0x01, 0x00, 0x00, 0x01},
29 {0x80, 0x20, 0x01, 0x00, 0x00, 0x01},
30 {0x40, 0x20, 0x01, 0x00, 0x00, 0x01},
31 {0x00, 0x20, 0x01, 0x00, 0x00, 0x01},
43 this->
cmd_data(CMD_PWR, {0x03, 0x00, 0x2B, 0x2B, 0x03});
44 this->
cmd_data(CMD_BTST, {0x17, 0x17, 0x17});
45 this->
cmd_data(CMD_PSR, {0xBF, 0x0D});
49 uint8_t lut[LUT_VCOM_SIZE];
50 for (
size_t i = 0; i != LUT_COUNT; i++) {
51 const size_t size = i == 0 ? LUT_VCOM_SIZE : LUT_SIZE;
53 this->
cmd_data(
static_cast<uint8_t
>(CMD_LUT_VCOM + i), lut,
size);
63 ESP_LOGV(TAG,
"Power on");
103 ESP_LOGV(TAG,
"Refresh screen (%s)", partial ? LOG_STR_LITERAL(
"partial") : LOG_STR_LITERAL(
"full"));
124 ESP_LOGV(TAG,
"Power off");
131 static_cast<uint8_t
>(
y_start >> 8),
static_cast<uint8_t
>(
y_start & 0xFF),
132 static_cast<uint8_t
>(y_end >> 8),
static_cast<uint8_t
>(y_end & 0xFF), 0x01});
void command(uint8_t value)
bool is_using_partial_update_() const
virtual bool initialise(bool partial)
split_buffer::SplitBuffer buffer_
void cmd_data(uint8_t command, const uint8_t *ptr, size_t length)
size_t current_data_index_
bool transfer_data() override
bool after_refresh() override
bool initialise(bool partial) override
void refresh_screen(bool partial) override
bool write_plane_(uint8_t command)
void send_partial_settings_()
void set_partial_window(uint16_t x_start, uint16_t x_end, uint16_t y_start, uint16_t y_end) override
void power_off() override
static constexpr uint8_t CMD_DTM2
static constexpr uint8_t CMD_REFRESH
static constexpr uint8_t CMD_POWER_OFF
static constexpr uint8_t CMD_PARTIAL_OUT
static constexpr uint8_t CMD_PARTIAL_WINDOW
static constexpr uint8_t CMD_PARTIAL_IN
static constexpr uint8_t CMD_POWER_ON
static constexpr uint8_t CMD_DTM1
static constexpr uint8_t CMD_CDI
void write_array(const uint8_t *data, size_t length)
const uint8_t * get_span(size_t index, size_t &length) const
constexpr uint8_t TESTCARD_FONT[3][8] PROGMEM
static void int int y_start
ESPHOME_LOG_TAG(TAG, "display")
void progmem_memcpy(void *dst, const void *src, size_t len)
uint32_t IRAM_ATTR HOT millis()