uploaded 2 months ago
ESP LCD Touch TT21100 - touch controller TT21100


ESP LCD Touch TT21100 Controller

Implementation of the TT21100 touch controller with esp_lcd_touch component.

Touch controller Communication interface Component name Link to datasheet
TT21100 I2C esp_lcd_touch_tt21100 ----

Add to project

Packages from this repository are uploaded to Espressif's component service. You can add them to your project via add-dependancy, e.g. add-dependency esp_lcd_touch_tt21100==1.0.0

Alternatively, you can create idf_component.yml. More is in Espressif's documentation.

Example use

Initialization of the touch component.

    esp_lcd_panel_io_i2c_config_t io_config = ESP_LCD_TOUCH_IO_I2C_TT21100_CONFIG();

    esp_lcd_touch_config_t tp_cfg = {
        .x_max = CONFIG_LCD_HRES,
        .y_max = CONFIG_LCD_VRES,
        .rst_gpio_num = -1,
        .int_gpio_num = -1,
        .levels = {
            .reset = 0,
            .interrupt = 0,
        .flags = {
            .swap_xy = 0,
            .mirror_x = 0,
            .mirror_y = 0,

    esp_lcd_touch_handle_t tp;
    esp_lcd_touch_new_i2c_tt21100(io_config, &tp_cfg, &tp);

Read data from the touch controller and store it in RAM memory. It should be called regularly in poll.


Get one X and Y coordinates with strength of touch.

    uint16_t touch_x[1];
    uint16_t touch_y[1];
    uint16_t touch_strength[1];
    uint8_t touch_cnt = 0;

    bool touchpad_pressed = esp_lcd_touch_get_coordinates(tp, touch_x, touch_y, touch_btn, &touch_cnt, 1);


Supports all targets

License: Apache-2.0

To add this component to your project, run: add-dependency "espressif/esp_lcd_touch_tt21100^1.0.3"

or download archive


  • espressif/esp_lcd_touch ^1.0
  • ESP-IDF >=4.4.2
  • Badge

    espressif/esp_lcd_touch_tt21100 version: 1.0.3