ESPHome  2024.10.2
tt21100.h
Go to the documentation of this file.
1 #pragma once
2 
6 #include "esphome/core/hal.h"
7 
8 #include <vector>
9 
10 namespace esphome {
11 namespace tt21100 {
12 
13 using namespace touchscreen;
14 
16  public:
17  virtual void update_button(uint8_t index, uint16_t state) = 0;
18 };
19 
21  public:
22  void setup() override;
23  void dump_config() override;
24  float get_setup_priority() const override;
25 
26  void set_interrupt_pin(InternalGPIOPin *pin) { this->interrupt_pin_ = pin; }
27  void set_reset_pin(GPIOPin *pin) { this->reset_pin_ = pin; }
28 
29  void register_button_listener(TT21100ButtonListener *listener) { this->button_listeners_.push_back(listener); }
30 
31  protected:
32  void reset_();
33 
34  void update_touches() override;
35 
37  GPIOPin *reset_pin_{nullptr};
38 
39  std::vector<TT21100ButtonListener *> button_listeners_;
40 };
41 
42 } // namespace tt21100
43 } // namespace esphome
void setup()
void set_reset_pin(GPIOPin *pin)
Definition: tt21100.h:27
std::vector< TT21100ButtonListener * > button_listeners_
Definition: tt21100.h:39
void register_button_listener(TT21100ButtonListener *listener)
Definition: tt21100.h:29
InternalGPIOPin * interrupt_pin_
Definition: tt21100.h:36
void set_interrupt_pin(InternalGPIOPin *pin)
Definition: tt21100.h:26
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133
bool state
Definition: fan.h:34