Lvgl and touchscreens

Hi,

I like to know, how lvgl is dealing with touchscreens.

My hard/software:

  • ArduinoIDE 2.3.4
  • ESP32 Package 3.3.0
  • LVGL 9.3.0
  • Arduino_GFX 1.6.2
  • 7inch MIPI-DSI-display and ESP32-P4
  • GT911 as touch controller

GT911 has interrupt-pin, but libraries for that controller don’t use it?

lvgl documention only writes:

my_input_read is a function pointer which will be called periodically to report the current state of an input device to LVGL.

So I make an empty function

void my_input_read(lv_indev_t * indev, lv_indev_data_t * data)
{
   Serial.print("T");
}

I get the letter T really fast on serial monitor. After changing the delay(5) at the end of loop() to delay(500), output to serial monitor slows down.

So I assume:

  1. lvgl calls the touchscreen function each time, when lv_task_handler() is called.
  2. It is a simple polling

Is this correct?

Bye, Jürgen

Hi @jho59lvgl

Yes, that is correct. LVGL doesn’t handle touch screen IRQs internally. LVGL calls your my_input_read periodically. You can use IRQs in your application to read the data from your touchscreen and then provide the data to LVGL on the next poll read