ESPHome  2024.5.0
ft63x6.h
Go to the documentation of this file.
1 /**************************************************************************/
6 /**************************************************************************/
7 
8 #pragma once
9 
12 #include "esphome/core/component.h"
13 
14 namespace esphome {
15 namespace ft63x6 {
16 
17 using namespace touchscreen;
18 
19 static const uint8_t FT6X36_DEFAULT_THRESHOLD = 22;
20 
22  public:
23  void setup() override;
24  void dump_config() 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  void set_threshold(uint8_t threshold) { this->threshold_ = threshold; }
29 
30  protected:
31  void hard_reset_();
32  void update_touches() override;
33 
34  InternalGPIOPin *interrupt_pin_{nullptr};
35  GPIOPin *reset_pin_{nullptr};
36  uint8_t threshold_{FT6X36_DEFAULT_THRESHOLD};
37 
38  uint8_t read_touch_number_();
39 
40  uint16_t read_touch_x_(uint8_t touch);
41  uint16_t read_touch_y_(uint8_t touch);
42  uint8_t read_touch_event_(uint8_t touch);
43  uint8_t read_touch_id_(uint8_t touch);
44  uint8_t read_touch_weight_(uint8_t touch);
45  uint8_t read_touch_misc_(uint8_t touch);
46 
47  uint8_t read_byte_(uint8_t addr);
48 };
49 
50 } // namespace ft63x6
51 } // namespace esphome
void setup()
void set_threshold(uint8_t threshold)
Definition: ft63x6.h:28
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
void set_interrupt_pin(InternalGPIOPin *pin)
Definition: ft63x6.h:26
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133
void set_reset_pin(GPIOPin *pin)
Definition: ft63x6.h:27