34#include "freertos/FreeRTOS.h"
40static const char *TAG =
"FT63XX";
46static bool init_done =
false;
48esp_err_t ft63x6_init()
50 ESP_LOGI(TAG,
"----DRIVER FT63XX----");
53#if CONFIG_I2C_COMMUNICATION_METHOD_CALLBACK_RW
55 uint8_t address = FT3267_SLAVE_ADDRESS;
58 i2c_drv_device_init(address);
60 ESP_LOGI(TAG,
"Implemented using read and write callback methods");
62 ESP_LOGI(TAG,
"Initialization of FT63XX is successful!");
64 ESP_LOGE(TAG,
"Failed to initialize the FT63XX!");
70#if CONFIG_I2C_COMMUNICATION_METHOD_BUILTIN_RW
71#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5,0,0)) && defined(CONFIG_SENSORLIB_ESP_IDF_NEW_API)
73 ESP_LOGI(TAG,
"Implemented using built-in read and write methods (Use higher version >= 5.0 API)");
77 extern i2c_master_bus_handle_t bus_handle;
80 ESP_LOGI(TAG,
"Initialization of FT63XX is successful!");
82 ESP_LOGE(TAG,
"Failed to initialize the FT63XX!");
88 ESP_LOGI(TAG,
"Implemented using built-in read and write methods (Use lower version < 5.0 API)");
89 if (
touch.
begin((i2c_port_t)CONFIG_I2C_MASTER_PORT_NUM, CONFIG_SENSOR_SDA, CONFIG_SENSOR_SCL)) {
90 ESP_LOGI(TAG,
"Initialization of FT63XX is successful!");
92 ESP_LOGE(TAG,
"Failed to initialize the FT63XX!");
110 for (
int i = 0;
i < numPoint; ++
i) {
111 ESP_LOGI(
"FT63X6",
"Point[%02d] - X:%02d Y:%02d",
i,
x[
i],
y[
i]);
bool begin(SensorCommCustom::CustomCallback callback, SensorCommCustomHal::CustomHalCallback hal_callback, uint8_t addr) override
Initialize the touch driver for custom communication.
virtual uint8_t getPoint(int16_t *x_array, int16_t *y_array, uint8_t get_point=1) __attribute__((deprecated("use getTouchPoints instead of getPoint")))
Retrieve touch point coordinates (deprecated).
uint32_t hal_callback(SensorCommCustomHal::Operation op, void *param1, void *param2)
bool i2c_wr_function(uint8_t addr, uint8_t reg, uint8_t *buf, size_t len, bool writeReg, bool isWrite)