|
1 | 1 | /* |
2 | | - * SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD |
| 2 | + * SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
@@ -72,6 +72,7 @@ typedef struct { |
72 | 72 | uint8_t points; /*!< Count of touch points saved */ |
73 | 73 |
|
74 | 74 | struct { |
| 75 | + uint8_t track_id; |
75 | 76 | uint16_t x; /*!< X coordinate */ |
76 | 77 | uint16_t y; /*!< Y coordinate */ |
77 | 78 | uint16_t strength; /*!< Strength */ |
@@ -145,6 +146,18 @@ struct esp_lcd_touch_s { |
145 | 146 | */ |
146 | 147 | bool (*get_xy)(esp_lcd_touch_handle_t tp, uint16_t *x, uint16_t *y, uint16_t *strength, uint8_t *point_num, uint8_t max_point_num); |
147 | 148 |
|
| 149 | + /** |
| 150 | + * @brief Get track ids of touch points |
| 151 | + * |
| 152 | + * @param tp: Touch handler |
| 153 | + * @param track_id: Array of track ids |
| 154 | + * @param point_num: Count of touched points to return |
| 155 | + * |
| 156 | + * @return |
| 157 | + * - ESP_OK on success, otherwise returns ESP_ERR_xxx |
| 158 | + */ |
| 159 | + esp_err_t (*get_track_id)(esp_lcd_touch_handle_t tp, uint8_t *track_id, uint8_t point_num); |
| 160 | + |
148 | 161 |
|
149 | 162 | #if (CONFIG_ESP_LCD_TOUCH_MAX_BUTTONS > 0) |
150 | 163 | /** |
@@ -287,6 +300,18 @@ esp_err_t esp_lcd_touch_read_data(esp_lcd_touch_handle_t tp); |
287 | 300 | bool esp_lcd_touch_get_coordinates(esp_lcd_touch_handle_t tp, uint16_t *x, uint16_t *y, uint16_t *strength, uint8_t *point_num, uint8_t max_point_num); |
288 | 301 |
|
289 | 302 |
|
| 303 | +/** |
| 304 | + * @brief Get track ids of touch points |
| 305 | + * |
| 306 | + * @param tp: Touch handler |
| 307 | + * @param track_id: Array of track ids |
| 308 | + * @param point_num: Count of touched points to return |
| 309 | + * |
| 310 | + * @return |
| 311 | + * - ESP_OK on success, otherwise returns ESP_ERR_xxx |
| 312 | + */ |
| 313 | +esp_err_t esp_lcd_touch_get_track_id(esp_lcd_touch_handle_t tp, uint8_t *track_id, uint8_t point_num); |
| 314 | + |
290 | 315 | #if (CONFIG_ESP_LCD_TOUCH_MAX_BUTTONS > 0) |
291 | 316 | /** |
292 | 317 | * @brief Get button state |
|
0 commit comments