Skip to content

Commit fa90840

Browse files
authored
feat(ws-s3-touch): Add espp::WsS3Touch Board Support Package (BSP) component for the Waveshare ESP32-S3 TouchLCD hardware. (#475)
* feat(ws-s3-touch): Add `espp::WsS3Touch` Board Support Package (BSP) component for the Waveshare ESP32-S3 TouchLCD hardware. * readme: update
1 parent bbd171a commit fa90840

22 files changed

+1488
-0
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ jobs:
192192
target: esp32
193193
- path: 'components/wrover-kit/example'
194194
target: esp32
195+
- path: 'components/ws-s3-touch/example'
196+
target: esp32s3
195197

196198
steps:
197199
- name: Checkout repo

.github/workflows/upload_components.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ jobs:
113113
components/vl53l
114114
components/wifi
115115
components/wrover-kit
116+
components/ws-s3-touch
116117
namespace: "espp"
117118
# use old version if this isn't a release for testing
118119
version: ${{ github.event.release && github.event.release.tag_name || 'v0.20.2' }}

components/ws-s3-touch/CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
idf_component_register(
2+
INCLUDE_DIRS "include"
3+
SRC_DIRS "src"
4+
REQUIRES driver base_component display display_drivers i2c input_drivers interrupt led cst816 task qmi8658
5+
REQUIRED_IDF_TARGETS "esp32s3"
6+
)

components/ws-s3-touch/Kconfig

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
menu "Waveshare ESP32-S3 TouchLCD Configuration"
2+
choice WS_S3_TOUCH_VERSION
3+
prompt "TouchLCD Version"
4+
default WS_S3_TOUCH_VERSION_NEW
5+
help
6+
Select the version of the Waveshare ESP32-S3 TouchLCD you are using.
7+
This will determine which pins the driver configures.
8+
9+
config WS_S3_TOUCH_VERSION_NEW
10+
bool "New Version"
11+
help
12+
The new version of the Waveshare ESP32-S3 TouchLCD uses different pins
13+
for the touch controller.
14+
15+
config WS_S3_TOUCH_VERSION_OLD
16+
bool "Old Version"
17+
help
18+
The old version of the Waveshare ESP32-S3 TouchLCD uses different pins
19+
for the touch controller.
20+
endchoice
21+
22+
config WS_S3_TOUCH_INTERRUPT_STACK_SIZE
23+
int "Interrupt stack size"
24+
default 4096
25+
help
26+
Size of the stack used for the interrupt handler. Used by the touch
27+
callback.
28+
endmenu

components/ws-s3-touch/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Waveshare ESP32-S3 TouchLCD Board Support Package (BSP) Component
2+
3+
[![Badge](https://components.espressif.com/components/espp/ws-s3-touch/badge.svg)](https://components.espressif.com/components/espp/ws-s3-touch)
4+
5+
The Waveshare ESP32-S3 TouchLCD is a development board for the ESP32-S3 module.
6+
It features a nice touchscreen display, an IMU, a buzzer, and a real-time clock
7+
(RTC).
8+
9+
The `espp::WsS3Touch` component provides a singleton hardware abstraction for
10+
initializing the touch, display, IMU, and audio subsystems.
11+
12+
## Example
13+
14+
The [example](./example) shows how to use the `espp::WsS3Touch` hardware
15+
abstraction component to automatically detect and initialize components on the
16+
Waveshare ESP32-S3 TouchLCD board.
17+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The following lines of boilerplate have to be in your project's CMakeLists
2+
# in this exact order for cmake to work correctly
3+
cmake_minimum_required(VERSION 3.20)
4+
5+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
6+
7+
# add the component directories that we want to use
8+
set(EXTRA_COMPONENT_DIRS
9+
"../../../components/"
10+
)
11+
12+
set(
13+
COMPONENTS
14+
"main esptool_py ws-s3-touch filters"
15+
CACHE STRING
16+
"List of components to include"
17+
)
18+
19+
project(ws_s3_touch_example)
20+
21+
set(CMAKE_CXX_STANDARD 20)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Waveshare ESP32-S3 TouchLCD Example
2+
3+
This example shows how to use the `espp::WsS3Touch` hardware abstraction
4+
component to automatically detect and initialize components on the Waveshare
5+
ESP32-S3 TouchLCD board, and use the LVGL graphics library to draw on the
6+
display. It also plays a sound when you touch the screen using the buzzer on the
7+
system, and it changes the frequency of the sound based on the position of the
8+
touch.
9+
10+
<img width="1260" height="949" alt="image" src="https://github.com/user-attachments/assets/17e8def4-0d64-4e9e-8cee-dc2753a657a6" />
11+
<img width="1260" height="949" alt="image" src="https://github.com/user-attachments/assets/512ca611-1ab0-4941-b4a3-4ef22d65e567" />
12+
13+
https://github.com/user-attachments/assets/e1905efc-d7cf-448a-86e8-a15c3f294f8c
14+
15+
## How to use example
16+
17+
### Hardware Required
18+
19+
This example is designed to run on the Waveshare ESP32-S3 TouchLCD board.
20+
21+
### Build and Flash
22+
23+
Build the project and flash it to the board, then run monitor tool to view
24+
serial output:
25+
26+
```
27+
idf.py -p PORT flash monitor
28+
```
29+
30+
(Replace PORT with the name of the serial port to use.)
31+
32+
(To exit the serial monitor, type ``Ctrl-]``.)
33+
34+
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
35+
36+
## Example Output
37+
38+
<img width="777" height="604" alt="CleanShot 2025-07-13 at 22 01 56" src="https://github.com/user-attachments/assets/02ea3513-7af9-43bb-96e4-10706f31f831" />
39+
40+
<img width="1260" height="949" alt="image" src="https://github.com/user-attachments/assets/17e8def4-0d64-4e9e-8cee-dc2753a657a6" />
41+
<img width="1260" height="949" alt="image" src="https://github.com/user-attachments/assets/512ca611-1ab0-4941-b4a3-4ef22d65e567" />
42+
43+
https://github.com/user-attachments/assets/e1905efc-d7cf-448a-86e8-a15c3f294f8c
44+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
idf_component_register(SRC_DIRS "."
2+
INCLUDE_DIRS ".")

0 commit comments

Comments
 (0)