ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
epaper_spi_bwr.h
Go to the documentation of this file.
1#pragma once
2
3#include "epaper_spi.h"
4
5namespace esphome::epaper_spi {
6
18class EPaperBWR : public EPaperBase {
19 public:
20 EPaperBWR(const char *name, uint16_t width, uint16_t height, const uint8_t *init_sequence,
21 size_t init_sequence_length, bool invert_red, bool red_sets_black = false)
22 : EPaperBase(name, width, height, init_sequence, init_sequence_length, DISPLAY_TYPE_COLOR, 1, 2),
23 invert_red_(invert_red),
24 red_sets_black_(red_sets_black) {}
25
26 void fill(Color color) override;
27
28 protected:
29 void draw_pixel_at(int x, int y, Color color) override;
30 bool transfer_data() override;
31
32 // Streams buffer_[current_data_index_ .. end) XORed with invert_mask in chunks; returns false if it yields on
33 // MAX_TRANSFER_TIME. Chip select is held for the whole range and released only on yield or completion.
34 // It only yields with data left to send, never at end: callers rely on this to tell from current_data_index_
35 // alone which plane a resumed push is in, and that a plane has just finished.
36 bool send_buffer_range_(size_t end, uint8_t invert_mask, uint32_t start_time);
37 // Sets buffer_[index .. end) to value, one contiguous span at a time.
38 void fill_range_(size_t index, size_t end, uint8_t value);
39
40 // Send the red plane as 0=red, 1=no red
42 // Red pixels also set their bit in the black/white plane, for panels that need black under red
44};
45
46} // namespace esphome::epaper_spi
Intermediate base for black/white/red panels with two 1-bit-per-pixel planes (8 pixels per byte).
EPaperBWR(const char *name, uint16_t width, uint16_t height, const uint8_t *init_sequence, size_t init_sequence_length, bool invert_red, bool red_sets_black=false)
void draw_pixel_at(int x, int y, Color color) override
void fill(Color color) override
void fill_range_(size_t index, size_t end, uint8_t value)
bool send_buffer_range_(size_t end, uint8_t invert_mask, uint32_t start_time)
uint32_t value
Definition hal.cpp:41
static void uint32_t
uint8_t end[39]
Definition sun_gtil2.cpp:17
uint16_t x
Definition tt21100.cpp:5
uint16_t y
Definition tt21100.cpp:6