Skip to content

Conversation

@PetrESP
Copy link
Collaborator

@PetrESP PetrESP commented Nov 21, 2025

ESP-BSP Pull Request checklist

  • Version of modified component bumped
  • CI passing

Change description

  • GT911 driver can now also read each touch point track ID
  • esp_lcd_touch library can read track IDs from low level drivers
  • LVGL port now detects multi-touch gestures when enabled
  • display example includes usage of multi-touch gestures

Note

Introduces multi-touch gesture support in LVGL port backed by a new structured touch data API, updates drivers to provide track IDs, and refreshes examples/docs and component versions.

  • LVGL Port (components/esp_lvgl_port)

    • Gesture support: Detects multi-touch gestures (pinch, rotate, two-finger swipe) when enabled; propagates touch data to LVGL gesture recognizers.
    • API usage: Touch read path switched to esp_lcd_touch_get_data; adds timestamps; docs describe enabling/config and thresholds.
    • Version: bump to 2.7.0 with changelog.
  • Touch Core (components/lcd_touch/esp_lcd_touch)

    • New API/structs: esp_lcd_touch_get_data + esp_lcd_touch_point_data_t (x, y, strength, track_id); get_coordinates deprecated.
    • Driver hook: optional get_track_id in driver vtable.
    • Robustness: argument checks switched to ESP_RETURN_ON_FALSE.
    • Version: bump to 1.2.0.
  • Touch Drivers

    • GT911: provides per-point track_id; integrates new checks; version 1.2.0.
    • FT5x06, GT1151, CST816S, STMPE610, TT21100: migrated to points_data[] access; minor validation updates; versions bumped.
  • Examples (examples/display)

    • Adds gesture callback (pinch zoom, rotation, two-finger swipe) and sets rotation threshold; enables CONFIG_LV_USE_GESTURE_RECOGNITION and float in defconfig.
  • BSP (bsp/m5dial)

    • Overrides esp_lcd_touch_ft5x06 path; README benchmark/date and LVGL version updated to 9.4 with new metrics.

Written by Cursor Bugbot for commit 6b0dd59. This will update automatically on new commits. Configure here.

@PetrESP PetrESP marked this pull request as ready for review November 21, 2025 08:52
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on December 20

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

@github-actions
Copy link

github-actions bot commented Nov 21, 2025

Test Results

28 tests   28 ✅  1m 31s ⏱️
 5 suites   0 💤
 5 files     0 ❌

Results for commit 6b0dd59.

♻️ This comment has been updated with latest results.

@PetrESP PetrESP force-pushed the petr/lvgl_multi_touch branch from 05aa5f5 to cd3dd64 Compare November 21, 2025 09:08
@PetrESP PetrESP force-pushed the petr/lvgl_multi_touch branch 2 times, most recently from ad4bf26 to 363d040 Compare November 21, 2025 11:27
@PetrESP PetrESP force-pushed the petr/lvgl_multi_touch branch from 363d040 to 221ef74 Compare November 21, 2025 11:59
Copy link
Collaborator

@tore-espressif tore-espressif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PetrESP Great work! We can go through it together tomorrow

Comment on lines 111 to 113
assert(tp != NULL);
assert(track_id != NULL);
assert(point_num > 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is a public API, I'd recommend returning an error if any of the input arguments is invalid.

Otherwise we get abort() call in debug configuration. However, in release configuration assert() is resolved to No-Operation, which could lead to hard faults later in the code

Comment on lines 306 to 308
* @param tp: Touch handler
* @param track_id: Array of track ids
* @param point_num: Count of touched points to return
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick, but useful. It wasn't clear to me from the first look. Also the parameter description could be made clearer...

 * @param[in] tp: Touch handler
 * @param[out] track_id: Array of track ids
 * @param[in] point_num: Count of touched points to return

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it supported by Doxygen? I am not sure - the task with Doxygen warnings is still open :-(

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've check and I don't think that it would even matter for doxygen. We do not generate any documentation from esp_lcd_touch. We only generate API files for BSPs where we add the direction of each argument. So maybe I could do it anyway to improve clarity of these comments?

@@ -1,4 +1,4 @@
version: "1.1.3"
version: "1.1.4"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We must bump esp_lcd_touch dependecy to at least 1.1.3 on line 7, because we use the new multi touch API that is introduced in esp_lcd_touch 1.1.3

### Detecting gestures

LVGL includes support for software detection of multi-touch gestures.
This detection can be enabled by setting the `LVGL_PORT_ENABLE_GESTURES` config and having `ESP_LCD_TOUCH_MAX_POINTS` > 1.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this LVGL_PORT_ENABLE_GESTURES config? What about enable it when it is enabled in LVGL - LV_USE_GESTURE_RECOGNITION + touch controller supports it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've enabled it for LV_USE_GESTURE_RECOGNITION in all cases. This option will need to be manually configured in sdkconfig so I think it is sufficient.

/* Initialize LVGL touch data for each activated touch point */
/* static */ lv_indev_touch_data_t touches[CONFIG_ESP_LCD_TOUCH_MAX_POINTS] = {0};
if (err != ESP_ERR_NOT_SUPPORTED) {
for (int i = 0; i < touchpad_cnt; i++) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to see some assert (or check) that touchpad_cnt <= CONFIG_ESP_LCD_TOUCH_MAX_POINTS

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check the latest change

Comment on lines 306 to 308
* @param tp: Touch handler
* @param track_id: Array of track ids
* @param point_num: Count of touched points to return
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it supported by Doxygen? I am not sure - the task with Doxygen warnings is still open :-(

@PetrESP PetrESP self-assigned this Nov 24, 2025
@PetrESP PetrESP force-pushed the petr/lvgl_multi_touch branch from 221ef74 to 6dd41de Compare November 24, 2025 16:16
@github-actions
Copy link

⚠️ Build failed for idf_ver=latest index=2

This failure was ignored (continue-on-error enabled).
See details: View build logs

@PetrESP PetrESP force-pushed the petr/lvgl_multi_touch branch from 6dd41de to 797fda1 Compare November 28, 2025 10:16
@PetrESP PetrESP force-pushed the petr/lvgl_multi_touch branch from 797fda1 to e10be6a Compare November 28, 2025 13:20
@PetrESP PetrESP force-pushed the petr/lvgl_multi_touch branch from e10be6a to 538c156 Compare November 28, 2025 13:29
@PetrESP PetrESP force-pushed the petr/lvgl_multi_touch branch from 538c156 to 6b0dd59 Compare November 28, 2025 14:45
@github-actions
Copy link

⚠️ Build failed for idf_ver=latest index=5

This failure was ignored (continue-on-error enabled).
See details: View build logs

@github-actions
Copy link

⚠️ Build failed for idf_ver=release-v6.0 index=5

This failure was ignored (continue-on-error enabled).
See details: View build logs

@github-actions
Copy link

⚠️ Build failed for idf_ver=latest index=4

This failure was ignored (continue-on-error enabled).
See details: View build logs

@github-actions
Copy link

⚠️ Build failed for idf_ver=release-v6.0 index=4

This failure was ignored (continue-on-error enabled).
See details: View build logs

@github-actions
Copy link

⚠️ Build failed for idf_ver=latest index=3

This failure was ignored (continue-on-error enabled).
See details: View build logs

@github-actions
Copy link

⚠️ Build failed for idf_ver=release-v6.0 index=3

This failure was ignored (continue-on-error enabled).
See details: View build logs

@github-actions
Copy link

⚠️ Build failed for idf_ver=release-v6.0 index=1

This failure was ignored (continue-on-error enabled).
See details: View build logs

@github-actions
Copy link

⚠️ Build failed for idf_ver=latest index=1

This failure was ignored (continue-on-error enabled).
See details: View build logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants