ESPHome 2026.8.0b4
Loading...
Searching...
No Matches
epaper_spi_inkplate6color.cpp
Go to the documentation of this file.
1// Reference: https://github.com/SolderedElectronics/Inkplate-Arduino-library (src/boards/Inkplate6COLOR)
2
4#include "colorconv.h"
5
6#include "esphome/core/log.h"
7
8namespace esphome::epaper_spi {
9
10static constexpr const char *const TAG = "epaper_spi.inkplate6color";
11
12// Native hardware color codes for this panel's 4-bit color values.
13enum Inkplate6ColorHex : uint8_t {
14 BLACK = 0,
15 WHITE = 1,
16 GREEN = 2,
17 BLUE = 3,
18 RED = 4,
19 YELLOW = 5,
20 ORANGE = 6,
21};
22
26
28 ESP_LOGV(TAG, "Power on");
29 this->command(0x04);
30}
31
33 ESP_LOGV(TAG, "Power off");
34 this->command(0x02);
35}
36
38 ESP_LOGV(TAG, "Refresh"); // full refresh only; partial is unused
39 this->cmd_data(0x12, {0x00});
40}
41
43 ESP_LOGV(TAG, "Deep sleep");
44 this->cmd_data(0x07, {0xA5});
45}
46
47} // namespace esphome::epaper_spi
void command(uint8_t value)
void cmd_data(uint8_t command, const uint8_t *ptr, size_t length)
constexpr NATIVE_COLOR color_to_bwyrgbo(Color color, NATIVE_COLOR hw_black, NATIVE_COLOR hw_white, NATIVE_COLOR hw_yellow, NATIVE_COLOR hw_red, NATIVE_COLOR hw_green, NATIVE_COLOR hw_blue, NATIVE_COLOR hw_orange)
Map RGB color to discrete BWYRGBO hex 7 color key.
Definition colorconv.h:164