ESPHome  2024.11.3
ft5x06_touchscreen.h
Go to the documentation of this file.
1 #pragma once
2 
6 #include "esphome/core/gpio.h"
7 #include "esphome/core/hal.h"
8 
9 namespace esphome {
10 namespace ft5x06 {
11 
12 enum VendorId {
14  FT5X06_ID_1 = 0x51,
15  FT5X06_ID_2 = 0x11,
16  FT5X06_ID_3 = 0xCD,
17 };
18 
19 enum FTCmd : uint8_t {
26  FT5X06_I_MODE = 0xA4,
28 };
29 
30 enum FTMode : uint8_t {
34 };
35 
36 static const size_t MAX_TOUCHES = 5; // max number of possible touches reported
37 
39  public:
40  void setup() override;
41  void dump_config() override;
42  void update_touches() override;
43 
44  void set_interrupt_pin(InternalGPIOPin *interrupt_pin) { this->interrupt_pin_ = interrupt_pin; }
45 
46  protected:
47  void continue_setup_();
48  bool err_check_(i2c::ErrorCode err, const char *msg);
49  bool set_mode_(FTMode mode);
51 
53 };
54 
55 } // namespace ft5x06
56 } // namespace esphome
bool err_check_(i2c::ErrorCode err, const char *msg)
BedjetMode mode
BedJet operating mode.
Definition: bedjet_codec.h:183
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
ErrorCode
Error codes returned by I2CBus and I2CDevice methods.
Definition: i2c_bus.h:11
void set_interrupt_pin(InternalGPIOPin *interrupt_pin)
This Class provides the methods to read/write bytes from/to an i2c device.
Definition: i2c.h:133