ESPHome 2025.5.0
Loading...
Searching...
No Matches
pcd_8544.h
Go to the documentation of this file.
1#pragma once
2
6
7namespace esphome {
8namespace pcd8544 {
9
11 public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_HIGH, spi::CLOCK_PHASE_TRAILING,
12 spi::DATA_RATE_8MHZ> {
13 public:
14 const uint8_t PCD8544_POWERDOWN = 0x04;
15 const uint8_t PCD8544_ENTRYMODE = 0x02;
16 const uint8_t PCD8544_EXTENDEDINSTRUCTION = 0x01;
17
18 const uint8_t PCD8544_DISPLAYBLANK = 0x0;
19 const uint8_t PCD8544_DISPLAYNORMAL = 0x4;
20 const uint8_t PCD8544_DISPLAYALLON = 0x1;
21 const uint8_t PCD8544_DISPLAYINVERTED = 0x5;
22
23 const uint8_t PCD8544_FUNCTIONSET = 0x20;
24 const uint8_t PCD8544_DISPLAYCONTROL = 0x08;
25 const uint8_t PCD8544_SETYADDR = 0x40;
26 const uint8_t PCD8544_SETXADDR = 0x80;
27
28 const uint8_t PCD8544_SETTEMP = 0x04;
29 const uint8_t PCD8544_SETBIAS = 0x10;
30 const uint8_t PCD8544_SETVOP = 0x80;
31 uint8_t contrast_;
32
33 void set_dc_pin(GPIOPin *dc_pin) { this->dc_pin_ = dc_pin; }
35 void set_contrast(uint8_t contrast) { this->contrast_ = contrast; }
36 float get_setup_priority() const override { return setup_priority::PROCESSOR; }
37
38 void command(uint8_t value);
39 void data(uint8_t value);
40
41 void initialize();
42 void dump_config() override;
43 void HOT display();
44
45 void update() override;
46
47 void fill(Color color) override;
48
49 void setup() override {
50 this->setup_pins_();
51 this->initialize();
52 }
53
55
56 protected:
57 void draw_absolute_pixel_internal(int x, int y, Color color) override;
58
59 void setup_pins_();
60
61 void init_reset_();
62
63 size_t get_buffer_length_();
64
65 void start_command_();
66 void end_command_();
67 void start_data_();
68 void end_data_();
69
70 int get_width_internal() override;
71 int get_height_internal() override;
72
75};
76
77} // namespace pcd8544
78} // namespace esphome
const uint8_t PCD8544_EXTENDEDINSTRUCTION
Definition pcd_8544.h:16
int get_width_internal() override
Definition pcd_8544.cpp:58
const uint8_t PCD8544_SETYADDR
Definition pcd_8544.h:25
void data(uint8_t value)
void set_dc_pin(GPIOPin *dc_pin)
Definition pcd_8544.h:33
const uint8_t PCD8544_POWERDOWN
Definition pcd_8544.h:14
const uint8_t PCD8544_SETVOP
Definition pcd_8544.h:30
void set_reset_pin(GPIOPin *reset)
Definition pcd_8544.h:34
int get_height_internal() override
Definition pcd_8544.cpp:59
void set_contrast(uint8_t contrast)
Definition pcd_8544.h:35
const uint8_t PCD8544_FUNCTIONSET
Definition pcd_8544.h:23
void setup() override
Definition pcd_8544.h:49
display::DisplayType get_display_type() override
Definition pcd_8544.h:54
void draw_absolute_pixel_internal(int x, int y, Color color) override
Definition pcd_8544.cpp:87
const uint8_t PCD8544_DISPLAYBLANK
Definition pcd_8544.h:18
const uint8_t PCD8544_SETXADDR
Definition pcd_8544.h:26
void update() override
Definition pcd_8544.cpp:114
const uint8_t PCD8544_SETTEMP
Definition pcd_8544.h:28
const uint8_t PCD8544_SETBIAS
Definition pcd_8544.h:29
const uint8_t PCD8544_DISPLAYALLON
Definition pcd_8544.h:20
void command(uint8_t value)
Definition pcd_8544.cpp:108
void fill(Color color) override
Definition pcd_8544.cpp:119
const uint8_t PCD8544_DISPLAYINVERTED
Definition pcd_8544.h:21
float get_setup_priority() const override
Definition pcd_8544.h:36
const uint8_t PCD8544_DISPLAYNORMAL
Definition pcd_8544.h:19
const uint8_t PCD8544_ENTRYMODE
Definition pcd_8544.h:15
const uint8_t PCD8544_DISPLAYCONTROL
Definition pcd_8544.h:24
void dump_config() override
Definition pcd_8544.cpp:101
The SPIDevice is what components using the SPI will create.
Definition spi.h:421
uint16_t reset
Definition ina226.h:5
const float PROCESSOR
For components that use data from sensors like displays.
Definition component.cpp:20
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
uint16_t x
Definition tt21100.cpp:5
uint16_t y
Definition tt21100.cpp:6