This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit e5b138dee0d1ed607ec92a02ce98ff1cb0840e9c
Author: wangjianyu3 <wangjian...@xiaomi.com>
AuthorDate: Sat Jul 5 02:55:18 2025 +0800

    boards/szpi-esp32s3: Enable touchscreen for LVGL
    
    1. Rotate the video screen 90 degrees right.
    2. Enable touchscreen for the LVGL configuration "lckfb-szpi-esp32s3:lvgl" 
and add lvgldemo autostart.
    
    Signed-off-by: wangjianyu3 <wangjian...@xiaomi.com>
---
 boards/xtensa/esp32s3/lckfb-szpi-esp32s3/Kconfig       | 18 ++++++++++++++++++
 .../esp32s3/lckfb-szpi-esp32s3/configs/lvgl/defconfig  | 15 +++++++++++++++
 .../esp32s3/lckfb-szpi-esp32s3/src/esp32s3_ft5x06.c    | 14 ++++++++++++++
 .../esp32s3/lckfb-szpi-esp32s3/src/etc/init.d/rcS      |  4 ++++
 4 files changed, 51 insertions(+)

diff --git a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/Kconfig 
b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/Kconfig
index 8d353159eb..10a43241da 100644
--- a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/Kconfig
+++ b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/Kconfig
@@ -5,4 +5,22 @@
 
 if ARCH_BOARD_ESP32S3_LCKFB_SZPI
 
+config ARCH_BOARD_ESP32S3_LCKFB_SZPI_DISPLAY_XRES
+       int
+       default LCD_ST7789_XRES
+       depends on LCD_ST7789
+
+config ARCH_BOARD_ESP32S3_LCKFB_SZPI_DISPLAY_YRES
+       int
+       default LCD_ST7789_YRES
+       depends on LCD_ST7789
+
+config ARCH_BOARD_ESP32S3_LCKFB_SZPI_TOUCHSCREEN_MIRRORY
+       bool "SZPI-ESP32-S3 Touchscreen mirror Y"
+       depends on INPUT_TOUCHSCREEN
+
+config ARCH_BOARD_ESP32S3_LCKFB_SZPI_TOUCHSCREEN_SWAPXY
+       bool "SZPI-ESP32-S3 Touchscreen sway X/Y"
+       depends on INPUT_TOUCHSCREEN
+
 endif # ARCH_BOARD_ESP32S3_LCKFB_SZPI
diff --git a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/configs/lvgl/defconfig 
b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/configs/lvgl/defconfig
index 277806a3b6..8119354fa5 100644
--- a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/configs/lvgl/defconfig
+++ b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/configs/lvgl/defconfig
@@ -13,6 +13,8 @@ CONFIG_ARCH="xtensa"
 CONFIG_ARCH_BOARD="lckfb-szpi-esp32s3"
 CONFIG_ARCH_BOARD_COMMON=y
 CONFIG_ARCH_BOARD_ESP32S3_LCKFB_SZPI=y
+CONFIG_ARCH_BOARD_ESP32S3_LCKFB_SZPI_TOUCHSCREEN_MIRRORY=y
+CONFIG_ARCH_BOARD_ESP32S3_LCKFB_SZPI_TOUCHSCREEN_SWAPXY=y
 CONFIG_ARCH_CHIP="esp32s3"
 CONFIG_ARCH_CHIP_ESP32S3=y
 CONFIG_ARCH_CHIP_ESP32S3WROOM1N16R8=y
@@ -49,10 +51,15 @@ CONFIG_ESP32S3_UART0=y
 CONFIG_ESPRESSIF_LEDC=y
 CONFIG_ESPRESSIF_LEDC_CHANNEL0_PIN=42
 CONFIG_ESPRESSIF_LEDC_TIMER0=y
+CONFIG_ETC_ROMFS=y
 CONFIG_EXAMPLES_FB=y
 CONFIG_EXAMPLES_LVGLDEMO=y
 CONFIG_EXAMPLES_PWM=y
+CONFIG_EXAMPLES_TOUCHSCREEN=y
 CONFIG_FS_PROCFS=y
+CONFIG_FS_ROMFS=y
+CONFIG_FT5X06_POLLMODE=y
+CONFIG_FT5X06_SINGLEPOINT=y
 CONFIG_GPIO_LOWER_HALF=y
 CONFIG_GRAPHICS_LVGL=y
 CONFIG_HAVE_CXX=y
@@ -60,6 +67,8 @@ CONFIG_HAVE_CXXINITIALIZE=y
 CONFIG_IDLETHREAD_STACKSIZE=3072
 CONFIG_INIT_ENTRYPOINT="nsh_main"
 CONFIG_INIT_STACKSIZE=3072
+CONFIG_INPUT=y
+CONFIG_INPUT_FT5X06=y
 CONFIG_INTELHEX_BINARY=y
 CONFIG_IOEXPANDER=y
 CONFIG_IOEXPANDER_NPINS=8
@@ -71,6 +80,10 @@ CONFIG_LCD_PORTRAIT=y
 CONFIG_LCD_ST7789=y
 CONFIG_LCD_ST7789_DATA_ENDIAN_LITTLE=y
 CONFIG_LCD_ST7789_FREQUENCY=40000000
+CONFIG_LCD_ST7789_MIRRORV=y
+CONFIG_LCD_ST7789_MIRRORX=y
+CONFIG_LCD_ST7789_XRES=320
+CONFIG_LCD_ST7789_YRES=240
 CONFIG_LINE_MAX=64
 CONFIG_LV_USE_CLIB_MALLOC=y
 CONFIG_LV_USE_CLIB_SPRINTF=y
@@ -79,6 +92,7 @@ CONFIG_LV_USE_DEMO_WIDGETS=y
 CONFIG_LV_USE_LOG=y
 CONFIG_LV_USE_NUTTX=y
 CONFIG_LV_USE_NUTTX_LCD=y
+CONFIG_LV_USE_NUTTX_TOUCHSCREEN=y
 CONFIG_LV_USE_ST7789=y
 CONFIG_MM_REGIONS=2
 CONFIG_NSH_ARCHINIT=y
@@ -89,6 +103,7 @@ CONFIG_PREALLOC_TIMERS=4
 CONFIG_RAM_SIZE=114688
 CONFIG_RAM_START=0x20000000
 CONFIG_RR_INTERVAL=200
+CONFIG_SCHED_HPWORK=y
 CONFIG_SCHED_WAITPID=y
 CONFIG_SPI_CMDDATA=y
 CONFIG_START_DAY=6
diff --git a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3_ft5x06.c 
b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3_ft5x06.c
index d680240eed..917f984c12 100644
--- a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3_ft5x06.c
+++ b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/esp32s3_ft5x06.c
@@ -33,6 +33,7 @@
 #include <nuttx/arch.h>
 #include <nuttx/board.h>
 #include <nuttx/input/ft5x06.h>
+#include <nuttx/input/touchscreen.h>
 
 #include "esp32s3_i2c.h"
 #include "esp32s3-szpi.h"
@@ -55,6 +56,19 @@ static const struct ft5x06_config_s g_ft5x06_config =
 {
   .address   = FT5X06_I2C_ADDRESS,
   .frequency = FT5X06_FREQUENCY,
+  .lower =
+    {
+      .xres = CONFIG_ARCH_BOARD_ESP32S3_LCKFB_SZPI_DISPLAY_XRES,
+      .yres = CONFIG_ARCH_BOARD_ESP32S3_LCKFB_SZPI_DISPLAY_YRES,
+      .flags = 0
+#ifdef CONFIG_ARCH_BOARD_ESP32S3_LCKFB_SZPI_TOUCHSCREEN_SWAPXY
+               | TOUCH_FLAG_SWAPXY
+#endif
+#ifdef CONFIG_ARCH_BOARD_ESP32S3_LCKFB_SZPI_TOUCHSCREEN_MIRRORY
+               | TOUCH_FLAG_MIRRORY
+#endif
+               ,
+    },
 };
 
 /****************************************************************************
diff --git a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/etc/init.d/rcS 
b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/etc/init.d/rcS
index 1e043aa976..c0d9a0faaa 100644
--- a/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/etc/init.d/rcS
+++ b/boards/xtensa/esp32s3/lckfb-szpi-esp32s3/src/etc/init.d/rcS
@@ -29,3 +29,7 @@ adbd &
 #ifdef CONFIG_SYSTEM_FASTBOOTD
 fastbootd &
 #endif
+
+#ifdef CONFIG_EXAMPLES_LVGLDEMO
+lvgldemo widgets &
+#endif

Reply via email to