ESPHome  2024.5.0
gt911_touchscreen.h
Go to the documentation of this file.
1 #pragma once
2 
6 #include "esphome/core/hal.h"
7 
8 namespace esphome {
9 namespace gt911 {
10 
12  public:
13  virtual void update_button(uint8_t index, bool state) = 0;
14 };
15 
17  public:
18  void setup() override;
19  void dump_config() override;
20 
21  void set_interrupt_pin(InternalGPIOPin *pin) { this->interrupt_pin_ = pin; }
22  void register_button_listener(GT911ButtonListener *listener) { this->button_listeners_.push_back(listener); }
23 
24  protected:
25  void update_touches() override;
26 
27  InternalGPIOPin *interrupt_pin_{};
28  std::vector<GT911ButtonListener *> button_listeners_;
29  uint8_t button_state_{0xFF}; // last button state. Initial FF guarantees first update.
30 };
31 
32 } // namespace gt911
33 } // namespace esphome
void setup()
void set_interrupt_pin(InternalGPIOPin *pin)
virtual void update_button(uint8_t index, bool state)=0
std::vector< GT911ButtonListener * > button_listeners_
void register_button_listener(GT911ButtonListener *listener)
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
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