ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
epaper_spi_4bpp.h
Go to the documentation of this file.
1#pragma once
2
3#include "epaper_spi.h"
4
5namespace esphome::epaper_spi {
6
14class EPaper4bpp : public EPaperBase {
15 public:
16 EPaper4bpp(const char *name, uint16_t width, uint16_t height, const uint8_t *init_sequence,
17 size_t init_sequence_length)
18 : EPaperBase(name, width, height, init_sequence, init_sequence_length, DISPLAY_TYPE_COLOR, 4) {}
19
20 void fill(Color color) override;
21
22 protected:
23 void draw_pixel_at(int x, int y, Color color) override;
24 bool transfer_data() override;
25
27 virtual uint8_t color_to_native(Color color) = 0;
28
29 static constexpr uint8_t CMD_TRANSFER_DATA = 0x10;
30};
31
32} // namespace esphome::epaper_spi
Intermediate base for panels with a 4-bit-per-pixel native buffer layout (2 pixels per byte).
void draw_pixel_at(int x, int y, Color color) override
virtual uint8_t color_to_native(Color color)=0
Map an RGB color to this panel's native 4-bit color key (low nibble).
void fill(Color color) override
static constexpr uint8_t CMD_TRANSFER_DATA
EPaper4bpp(const char *name, uint16_t width, uint16_t height, const uint8_t *init_sequence, size_t init_sequence_length)
uint16_t x
Definition tt21100.cpp:5
uint16_t y
Definition tt21100.cpp:6