ESPHome  2024.12.2
ssd1325_base.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "esphome/core/hal.h"
6 
7 namespace esphome {
8 namespace ssd1325_base {
9 
16 };
17 
19  public:
20  void setup() override;
21 
22  void display();
23 
24  void update() override;
25 
26  void set_model(SSD1325Model model) { this->model_ = model; }
27  void set_reset_pin(GPIOPin *reset_pin) { this->reset_pin_ = reset_pin; }
28  void set_external_vcc(bool external_vcc) { this->external_vcc_ = external_vcc; }
29  void init_brightness(float brightness) { this->brightness_ = brightness; }
30  void set_brightness(float brightness);
31  bool is_on();
32  void turn_on();
33  void turn_off();
34 
35  float get_setup_priority() const override { return setup_priority::PROCESSOR; }
36  void fill(Color color) override;
37 
39 
40  protected:
41  virtual void command(uint8_t value) = 0;
42  virtual void write_display_data() = 0;
43  void init_reset_();
44 
45  void draw_absolute_pixel_internal(int x, int y, Color color) override;
46 
47  int get_height_internal() override;
48  int get_width_internal() override;
49  size_t get_buffer_length_();
50  const char *model_str_();
51 
53  GPIOPin *reset_pin_{nullptr};
54  bool external_vcc_{false};
55  bool is_on_{false};
56  float brightness_{1.0};
57 };
58 
59 } // namespace ssd1325_base
60 } // namespace esphome
virtual void command(uint8_t value)=0
void draw_absolute_pixel_internal(int x, int y, Color color) override
void init_brightness(float brightness)
Definition: ssd1325_base.h:29
uint16_t x
Definition: tt21100.cpp:17
virtual void write_display_data()=0
float get_setup_priority() const override
Definition: ssd1325_base.h:35
void fill(Color color) override
uint16_t y
Definition: tt21100.cpp:18
void set_model(SSD1325Model model)
Definition: ssd1325_base.h:26
void set_external_vcc(bool external_vcc)
Definition: ssd1325_base.h:28
const float PROCESSOR
For components that use data from sensors like displays.
Definition: component.cpp:20
display::DisplayType get_display_type() override
Definition: ssd1325_base.h:38
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void set_reset_pin(GPIOPin *reset_pin)
Definition: ssd1325_base.h:27
void set_brightness(float brightness)