On-chip gesture decoding

II’m looking for some guidance. I’m running lvgl on stm32 mcu and a P169H002-CTP smartphone display. This display is a 240x280 lcd with ST7789 lcd driver and a CST816T capacitive touch panel.
Right now lvgl gets touch coordinates every 10ms or so, and detects gestures (swipe up, etc.) in software. This works, but can be cpu-intensive.
If instead the touch driver ic is used to decode gestures, the interrupt rate drops from one interrupt per 10 ms to one interrupt per gesture. This is a notable decrease in cpu load. The data the touch ic provides are (x, y) coordinates and a gesture: single click, double click, long press, swipe up, swipe down, swipe left, swipe right.
What is the cleanest way to integrate this on-chip gesture decoding in lvgl?


There is no clean way to integrate external gestures because to make them work you needed to disable LVGL’s internal gesture detection.

Your touch controller might have an interrupt pin to decide if the touchpad is pressed or not.