ESPHome  2022.6.2
ssd1327_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 ssd1327_base {
9 
12 };
13 
15  public:
16  void setup() override;
17 
18  void display();
19 
20  void update() override;
21 
22  void set_model(SSD1327Model model) { this->model_ = model; }
23  void set_reset_pin(GPIOPin *reset_pin) { this->reset_pin_ = reset_pin; }
24  void init_brightness(float brightness) { this->brightness_ = brightness; }
25  void set_brightness(float brightness);
26  bool is_on();
27  void turn_on();
28  void turn_off();
29 
30  float get_setup_priority() const override { return setup_priority::PROCESSOR; }
31  void fill(Color color) override;
32 
34 
35  protected:
36  virtual void command(uint8_t value) = 0;
37  virtual void write_display_data() = 0;
38  void init_reset_();
39 
40  void draw_absolute_pixel_internal(int x, int y, Color color) override;
41 
42  int get_height_internal() override;
43  int get_width_internal() override;
44  size_t get_buffer_length_();
45  const char *model_str_();
46 
48  GPIOPin *reset_pin_{nullptr};
49  bool is_on_{false};
50  float brightness_{1.0};
51 };
52 
53 } // namespace ssd1327_base
54 } // namespace esphome
void draw_absolute_pixel_internal(int x, int y, Color color) override
This class simplifies creating components that periodically check a state.
Definition: component.h:266
void set_brightness(float brightness)
float get_setup_priority() const override
Definition: ssd1327_base.h:30
const float PROCESSOR
For components that use data from sensors like displays.
Definition: component.cpp:19
virtual void write_display_data()=0
virtual void command(uint8_t value)=0
void fill(Color color) override
void set_model(SSD1327Model model)
Definition: ssd1327_base.h:22
void init_brightness(float brightness)
Definition: ssd1327_base.h:24
display::DisplayType get_display_type() override
Definition: ssd1327_base.h:33
Definition: a4988.cpp:4
void set_reset_pin(GPIOPin *reset_pin)
Definition: ssd1327_base.h:23