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