|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
GT911 capacitive touch controller driver over I2C (Inter-Integrated Circuit). More...
Go to the source code of this file.
Data Structures | |
| struct | gt911_config_t |
Typedefs | |
| typedef struct gt911_dev_t * | gt911_handle_t |
Functions | |
| esp_err_t | gt911_new (i2c_master_bus_handle_t bus, const gt911_config_t *cfg, gt911_handle_t *out) |
| esp_err_t | gt911_del (gt911_handle_t h) |
| uint16_t | gt911_address (gt911_handle_t h) |
| esp_err_t | gt911_info (gt911_handle_t h, char product_id[5], uint16_t *fw_version) |
| esp_err_t | gt911_resolution (gt911_handle_t h, uint16_t *x_max, uint16_t *y_max) |
| esp_err_t | gt911_read (gt911_handle_t h, touch_point_t *out, int max, int *count, bool *fresh) |
GT911 capacitive touch controller driver over I2C (Inter-Integrated Circuit).
The GT911 uses 16-bit big-endian register addresses. Coordinates live in a buffer whose ready flag the host clears after each read; while the flag is set the controller does not update the buffer.
SPDX-License-Identifier: MIT
| uint16_t gt911_address | ( | gt911_handle_t | h | ) |
I2C address the driver settled on.
| esp_err_t gt911_info | ( | gt911_handle_t | h, |
| char | product_id[5], | ||
| uint16_t * | fw_version ) |
Product id string ("911") and firmware version.
| esp_err_t gt911_new | ( | i2c_master_bus_handle_t | bus, |
| const gt911_config_t * | cfg, | ||
| gt911_handle_t * | out ) |
Attach to a controller already out of reset.
| esp_err_t gt911_read | ( | gt911_handle_t | h, |
| touch_point_t * | out, | ||
| int | max, | ||
| int * | count, | ||
| bool * | fresh ) |
Read the current contacts and acknowledge the buffer.
| out | receives up to max points, in controller coordinates |
| max | capacity of out |
| count | receives the number of contacts (0 when all fingers lifted) |
| fresh | optional; false means the controller had no new data and count/ left untouched |
| esp_err_t gt911_resolution | ( | gt911_handle_t | h, |
| uint16_t * | x_max, | ||
| uint16_t * | y_max ) |
Resolution the controller was configured with.