Indev: Add support for GT911 touch driver by @dastarling
This commit is contained in:
parent
d379a4e851
commit
f726311525
|
@ -70,6 +70,8 @@ if(CONFIG_LV_TOUCH_CONTROLLER)
|
||||||
list(APPEND SOURCES "lvgl_touch/FT81x.c")
|
list(APPEND SOURCES "lvgl_touch/FT81x.c")
|
||||||
elseif(CONFIG_LV_TOUCH_CONTROLLER_RA8875)
|
elseif(CONFIG_LV_TOUCH_CONTROLLER_RA8875)
|
||||||
list(APPEND SOURCES "lvgl_touch/ra8875_touch.c")
|
list(APPEND SOURCES "lvgl_touch/ra8875_touch.c")
|
||||||
|
elseif(CONFIG_LV_TOUCH_CONTROLLER_GT911)
|
||||||
|
list(APPEND SOURCES "lvgl_touch/gt911.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(CONFIG_LV_TOUCH_DRIVER_PROTOCOL_SPI)
|
if(CONFIG_LV_TOUCH_DRIVER_PROTOCOL_SPI)
|
||||||
|
|
|
@ -9,6 +9,7 @@ menu "LVGL Touch controller"
|
||||||
default 4 if LV_TOUCH_CONTROLLER_ADCRAW
|
default 4 if LV_TOUCH_CONTROLLER_ADCRAW
|
||||||
default 5 if LV_TOUCH_CONTROLLER_FT81X
|
default 5 if LV_TOUCH_CONTROLLER_FT81X
|
||||||
default 6 if LV_TOUCH_CONTROLLER_RA8875
|
default 6 if LV_TOUCH_CONTROLLER_RA8875
|
||||||
|
default 7 if LV_TOUCH_CONTROLLER_GT911
|
||||||
|
|
||||||
choice
|
choice
|
||||||
prompt "Select a touch panel controller model."
|
prompt "Select a touch panel controller model."
|
||||||
|
@ -36,6 +37,9 @@ menu "LVGL Touch controller"
|
||||||
config LV_TOUCH_CONTROLLER_RA8875
|
config LV_TOUCH_CONTROLLER_RA8875
|
||||||
select LV_TOUCH_DRIVER_DISPLAY
|
select LV_TOUCH_DRIVER_DISPLAY
|
||||||
bool "RA8875"
|
bool "RA8875"
|
||||||
|
config LV_TOUCH_CONTROLLER_GT911
|
||||||
|
select LV_TOUCH_DRIVER_PROTOCOL_I2C
|
||||||
|
bool "GT911"
|
||||||
endchoice
|
endchoice
|
||||||
|
|
||||||
config LV_TOUCH_DRIVER_PROTOCOL_SPI
|
config LV_TOUCH_DRIVER_PROTOCOL_SPI
|
||||||
|
@ -499,4 +503,49 @@ menu "LVGL Touch controller"
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
|
menu "Touchpanel (GT911) Pin Assignments"
|
||||||
|
depends on LV_TOUCH_CONTROLLER_GT911
|
||||||
|
|
||||||
|
config LV_TOUCH_I2C_SDA
|
||||||
|
int
|
||||||
|
prompt "GPIO for SDA (I2C)"
|
||||||
|
range 0 39 if IDF_TARGET_ESP32
|
||||||
|
range 0 43 if IDF_TARGET_ESP32S2
|
||||||
|
range 0 21 if IDF_TARGET_ESP32C3
|
||||||
|
|
||||||
|
default 2
|
||||||
|
help
|
||||||
|
Configure the I2C touchpanel SDA pin here.
|
||||||
|
|
||||||
|
config LV_TOUCH_I2C_SCL
|
||||||
|
int "GPIO for clock signal SCL (I2C)"
|
||||||
|
range 0 39 if IDF_TARGET_ESP32
|
||||||
|
range 0 43 if IDF_TARGET_ESP32S2
|
||||||
|
range 0 21 if IDF_TARGET_ESP32C3
|
||||||
|
|
||||||
|
default 3
|
||||||
|
help
|
||||||
|
Configure the I2C touchpanel SCL pin here.
|
||||||
|
endmenu
|
||||||
|
|
||||||
|
menu "Touchpanel Configuration (GT911)"
|
||||||
|
depends on LV_TOUCH_CONTROLLER_GT911
|
||||||
|
|
||||||
|
config LV_GT911_SWAPXY
|
||||||
|
bool
|
||||||
|
prompt "Swap X with Y coordinate."
|
||||||
|
default y
|
||||||
|
|
||||||
|
config LV_GT911_INVERT_X
|
||||||
|
bool
|
||||||
|
prompt "Invert X coordinate value."
|
||||||
|
default n
|
||||||
|
|
||||||
|
config LV_GT911_INVERT_Y
|
||||||
|
bool
|
||||||
|
prompt "Invert Y coordinate value."
|
||||||
|
default y
|
||||||
|
|
||||||
|
endmenu
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
|
|
@ -21,6 +21,8 @@ void touch_driver_init(void)
|
||||||
/* nothing to do */
|
/* nothing to do */
|
||||||
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_RA8875)
|
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_RA8875)
|
||||||
ra8875_touch_init();
|
ra8875_touch_init();
|
||||||
|
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_GT911)
|
||||||
|
gt911_init(GT911_I2C_SLAVE_ADDR);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +42,8 @@ bool touch_driver_read(lv_indev_drv_t *drv, lv_indev_data_t *data)
|
||||||
res = FT81x_read(drv, data);
|
res = FT81x_read(drv, data);
|
||||||
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_RA8875)
|
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_RA8875)
|
||||||
res = ra8875_touch_read(drv, data);
|
res = ra8875_touch_read(drv, data);
|
||||||
|
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_GT911)
|
||||||
|
res = gt911_read(drv, data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -32,6 +32,8 @@ extern "C" {
|
||||||
#include "FT81x.h"
|
#include "FT81x.h"
|
||||||
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_RA8875)
|
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_RA8875)
|
||||||
#include "ra8875_touch.h"
|
#include "ra8875_touch.h"
|
||||||
|
#elif defined (CONFIG_LV_TOUCH_CONTROLLER_GT911)
|
||||||
|
#include "gt911.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
|
|
Loading…
Reference in a new issue