ESPHome
2026.10.0-dev
Loading...
Searching...
No Matches
esphome
components
epaper_spi
epaper_spi_spectra_e6.cpp
Go to the documentation of this file.
1
#include "
epaper_spi_spectra_e6.h
"
2
#include "
colorconv.h
"
3
4
#include "
esphome/core/log.h
"
5
6
namespace
esphome::epaper_spi
{
7
static
constexpr
const
char
*
const
TAG =
"epaper_spi.6c"
;
8
9
// Native hardware color codes for this panel's 4-bit color values.
10
enum
E6Color
: uint8_t {
11
BLACK
= 0,
12
WHITE
= 1,
13
YELLOW
= 2,
14
RED
= 3,
15
BLUE
= 5,
16
GREEN
= 6,
17
};
18
19
uint8_t
EPaperSpectraE6::color_to_native
(
Color
color) {
20
return
color_to_bwyrgb<uint8_t>
(color,
BLACK
,
WHITE
,
YELLOW
,
RED
,
GREEN
,
BLUE
);
21
}
22
23
void
EPaperSpectraE6::power_on
() {
24
ESP_LOGV(TAG,
"Power on"
);
25
this->
command
(0x04);
26
}
27
28
void
EPaperSpectraE6::power_off
() {
29
ESP_LOGV(TAG,
"Power off"
);
30
this->
cmd_data
(0x02, {0x00});
31
}
32
33
void
EPaperSpectraE6::refresh_screen
(
bool
partial) {
34
ESP_LOGV(TAG,
"Refresh"
);
35
this->
cmd_data
(0x12, {0x00});
36
}
37
38
void
EPaperSpectraE6::deep_sleep
() {
39
ESP_LOGV(TAG,
"Deep sleep"
);
40
this->
cmd_data
(0x07, {0xA5});
41
}
42
}
// namespace esphome::epaper_spi
esphome::epaper_spi::EPaperBase::command
void command(uint8_t value)
Definition
epaper_spi.cpp:60
esphome::epaper_spi::EPaperBase::cmd_data
void cmd_data(uint8_t command, const uint8_t *ptr, size_t length)
Definition
epaper_spi.cpp:69
esphome::epaper_spi::EPaperSpectraE6::refresh_screen
void refresh_screen(bool partial) override
Definition
epaper_spi_spectra_e6.cpp:33
esphome::epaper_spi::EPaperSpectraE6::power_on
void power_on() override
Definition
epaper_spi_spectra_e6.cpp:23
esphome::epaper_spi::EPaperSpectraE6::power_off
void power_off() override
Definition
epaper_spi_spectra_e6.cpp:28
esphome::epaper_spi::EPaperSpectraE6::deep_sleep
void deep_sleep() override
Definition
epaper_spi_spectra_e6.cpp:38
esphome::epaper_spi::EPaperSpectraE6::color_to_native
uint8_t color_to_native(Color color) override
Definition
epaper_spi_spectra_e6.cpp:19
colorconv.h
epaper_spi_spectra_e6.h
log.h
esphome::epaper_spi
Definition
colorconv.h:14
esphome::epaper_spi::E6Color
E6Color
Definition
epaper_spi_spectra_e6.cpp:10
esphome::epaper_spi::GREEN
@ GREEN
Definition
epaper_spi_inkplate6color.cpp:16
esphome::epaper_spi::RED
@ RED
Definition
epaper_spi_inkplate6color.cpp:18
esphome::epaper_spi::BLUE
@ BLUE
Definition
epaper_spi_inkplate6color.cpp:17
esphome::epaper_spi::WHITE
@ WHITE
Definition
epaper_spi_inkplate6color.cpp:15
esphome::epaper_spi::YELLOW
@ YELLOW
Definition
epaper_spi_inkplate6color.cpp:19
esphome::epaper_spi::BLACK
@ BLACK
Definition
epaper_spi_inkplate6color.cpp:14
esphome::epaper_spi::color_to_bwyrgb
constexpr NATIVE_COLOR color_to_bwyrgb(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)
Map RGB color to discrete BWYRGB hex 6 color key.
Definition
colorconv.h:102
esphome::Color
Definition
color.h:26
Generated by
1.12.0