-
Notifications
You must be signed in to change notification settings - Fork 2.1k
boards/waveshare-esp32s3-touch-lcd-128: add board support #22231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
8fb6992
084158b
6e7abd9
1a2cdf5
e5e8638
696cfea
4c4c0cd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # SPDX-FileCopyrightText: 2026 Technische Universität Hamburg | ||
| # SPDX-License-Identifier: LGPL-2.1-only | ||
|
|
||
| config BOARD | ||
| default "waveshare-esp32s3-touch-lcd-128" if BOARD_WAVESHARE_ESP32S3_TOUCH_LCD_128 | ||
|
|
||
| config BOARD_WAVESHARE_ESP32S3_TOUCH_LCD_128 | ||
| bool | ||
| default y | ||
| select BOARD_COMMON_ESP32S3 | ||
| select CPU_MODEL_ESP32S3_R2 | ||
|
|
||
| source "$(RIOTBOARD)/common/esp32s3/Kconfig" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| MODULE = board | ||
|
|
||
| include $(RIOTBASE)/Makefile.base |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ifneq (,$(filter saul_default,$(USEMODULE))) | ||
| USEMODULE += saul_gpio | ||
| endif | ||
|
|
||
| ifneq (,$(filter disp_dev,$(USEMODULE))) | ||
| USEMODULE += gc9a01 | ||
| endif | ||
|
|
||
| ifneq (,$(filter touch_dev,$(USEMODULE))) | ||
| USEMODULE += cst816s | ||
| endif | ||
|
|
||
| include $(RIOTBOARD)/common/esp32s3/stdio_esp32s3_default.dep.mk | ||
| include $(RIOTBOARD)/common/esp32s3/Makefile.dep | ||
|
|
||
| USEMODULE += boards_common_esp32s3 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # the board uses an ESP32-S3R2 with 2 MB embedded SPI RAM. | ||
| CPU_MODEL = esp32s3_r2 | ||
|
|
||
| # common board and CPU features | ||
| include $(RIOTBOARD)/common/esp32s3/Makefile.features | ||
|
|
||
| # peripherals provided by the board | ||
| FEATURES_PROVIDED += periph_adc | ||
| FEATURES_PROVIDED += periph_i2c | ||
| FEATURES_PROVIDED += periph_spi | ||
| FEATURES_PROVIDED += periph_usbdev | ||
|
|
||
| # other features provided by the board | ||
| FEATURES_PROVIDED += esp_spi_ram |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| PORT_LINUX ?= /dev/ttyACM0 | ||
|
|
||
| OPENOCD_CONFIG ?= board/esp32s3-builtin.cfg |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2023 Gunar Schorcht | ||
| * SPDX-License-Identifier: LGPL-2.1-only | ||
| */ | ||
|
|
||
| /** | ||
| * @ingroup boards_waveshare-esp32s3-touch-lcd-128 | ||
| * @{ | ||
| * | ||
| * @file | ||
| * @brief Board specific initializations for the Waveshare ESP32-S3 | ||
| * 1.28-inch round display board (Touch version) | ||
| * | ||
| * @author Gunar Schorcht <gunar@schorcht.net> | ||
| */ | ||
|
|
||
| #include "board.h" | ||
|
|
||
| void board_init(void) | ||
| { | ||
| #if MODULE_GC9A01 | ||
| gpio_init(LCD_BACKLIGHT, GPIO_OUT); | ||
| #endif | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| <!-- | ||
| SPDX-FileCopyrightText: 2023 Gunar Schorcht | ||
| SPDX-FileCopyrightText: 2026 Technische Universität Hamburg | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file looks quite as if it it is based on one of Gunars files too 🤔
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I followed the structure of Gunar's files for consistency with existing board docs.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't really tell how much was rewritten and how much was retained 🤷♂️
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding it to be safe. |
||
| SPDX-License-Identifier: LGPL-2.1-only | ||
| --> | ||
|
|
||
| @defgroup boards_waveshare-esp32s3-touch-lcd-128 Waveshare ESP32-S3-Touch-LCD-1.28 | ||
| @ingroup boards_esp32s3 | ||
| @brief Support for the Waveshare ESP32-S3-Touch-LCD-1.28 board | ||
| @author Gunar Schorcht <gunar@schorcht.net> | ||
| @author Yahia Abdella <yahia.abdella@tuhh.de> | ||
|
|
||
| \section waveshare_esp32s3_touch_lcd_128 Waveshare ESP32-S3-Touch-LCD-1.28 | ||
|
|
||
| ## Overview | ||
|
|
||
| The Waveshare ESP32-S3-Touch-LCD-1.28 is a compact development board built around the | ||
| ESP32-S3 microcontroller with an integrated 1.28-inch round TFT LCD display and | ||
| capacitive touch panel. | ||
|
|
||
| <img src="https://www.waveshare.net/photo/development-board/ESP32-S3-Touch-LCD-1.28/ESP32-S3-Touch-LCD-1.28-1.jpg" alt="Waveshare ESP32-S3-Touch-LCD-1.28" width="400" /> | ||
|
|
||
| The main features of the board are: | ||
|
|
||
| - ESP32-S3-N8R2 SoC with 2.4 GHz WiFi (802.11 b/g/n) and Bluetooth 5, BLE | ||
| - 16 MB Flash | ||
| - 2 MB PSRAM | ||
| - 1.28-inch 240x240 round IPS LCD (GC9A01 driver) | ||
| - Capacitive touch panel (CST816S controller) | ||
| - 6-axis IMU (QMI8658 accelerometer + gyroscope) | ||
| - USB Type-C connector | ||
| - Battery charging circuit with battery voltage monitoring | ||
| - BOOT button (active low, directly usable as user button) | ||
|
|
||
| ## Hardware | ||
|
|
||
| ### MCU | ||
|
|
||
| Most features of the board are provided by the ESP32-S3 SoC. For detailed | ||
| information about the ESP32-S3 SoC variant (family) and ESP32x SoCs, | ||
| see section \ref esp32_mcu_esp32 "ESP32 SoC Series". | ||
|
|
||
| ### Board Configuration | ||
|
|
||
| The board integrates a 1.28-inch round IPS LCD driven by a GC9A01 display controller | ||
| via SPI, a CST816S capacitive touch controller connected via I2C, and a QMI8658 | ||
| 6-axis IMU also connected via I2C. A BOOT button on GPIO0 is directly usable | ||
| as a user button. | ||
|
|
||
| The default board configuration provides: | ||
|
|
||
| - 1 x ADC channel (battery voltage monitoring) | ||
| - 1 x SPI (display) | ||
| - 1 x I2C (touch controller and IMU) | ||
| - 1 x UART (console) | ||
|
|
||
| The following table shows the default board configuration sorted by | ||
| peripheral function. This configuration can be overridden by | ||
| \ref esp32_application_specific_configurations | ||
| "application-specific configurations". | ||
|
|
||
| <center> | ||
| Function | GPIOs | Remarks | Configuration | ||
| :---------------|:-------|:--------|:---------------------------------- | ||
| BTN0 | GPIO0 | | | | ||
| ADC_LINE(0) | GPIO1 | Battery voltage | \ref esp32_adc_channels "ADC Channels" | ||
| SPI_DEV(0) CLK | GPIO10 | LCD SCLK, GC9A01 | \ref esp32_spi_interfaces "SPI Interfaces" | ||
| SPI_DEV(0) MOSI | GPIO11 | LCD SDA, GC9A01 | \ref esp32_spi_interfaces "SPI Interfaces" | ||
| SPI_DEV(0) MISO | GPIO12 | LCD SDO, GC9A01 | \ref esp32_spi_interfaces "SPI Interfaces" | ||
| SPI_DEV(0) CS0 | GPIO9 | LCD CS, GC9A01 | \ref esp32_spi_interfaces "SPI Interfaces" | ||
| LCD DC | GPIO8 | GC9A01 data/command | | | ||
| LCD RST | GPIO14 | GC9A01 reset | | | ||
| LCD BL | GPIO2 | Backlight control | | | ||
| I2C_DEV(0) SCL | GPIO7 | Touch + IMU | \ref esp32_i2c_interfaces "I2C Interfaces" | ||
| I2C_DEV(0) SDA | GPIO6 | Touch + IMU | \ref esp32_i2c_interfaces "I2C Interfaces" | ||
| Touch IRQ | GPIO5 | CST816S interrupt | | | ||
| Touch RST | GPIO13 | CST816S reset | | | ||
| UART_DEV(0) TxD | GPIO43 | Console (fixed) | \ref esp32_uart_interfaces "UART interfaces" | ||
| UART_DEV(0) RxD | GPIO44 | Console (fixed) | \ref esp32_uart_interfaces "UART interfaces" | ||
| </center> | ||
| <br> | ||
|
|
||
| For detailed information about the peripheral configurations of ESP32-S3 | ||
| boards, see section \ref esp32_peripherals "Common Peripherals". | ||
|
|
||
| ### Board Pinout | ||
|
|
||
| The following figures show the board hardware layout. | ||
|
|
||
| <img src="https://docs.waveshare.com/assets/images/Esp32-s3-touch-lcd-1.28-003-c7bcf4bd1440b55a43abb060ad67d705.webp" alt="Waveshare ESP32-S3-Touch-LCD-1.28 Hardware Layout" width="600" /> | ||
|
|
||
| <img src="https://docs.waveshare.com/assets/images/ESP32-S3-Touch-LCD-1.28-pin-e2103bcf84f511752bbc41ceb86bbf56.webp" alt="Waveshare ESP32-S3-Touch-LCD-1.28 Hardware Layout" width="600" /> | ||
|
|
||
| The board schematic and additional documentation can be found on the | ||
| [Waveshare Wiki](https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-1.28). | ||
|
|
||
| ## Flashing the Device | ||
|
|
||
| Flashing RIOT is quite easy. The board has a USB-C connector with | ||
| reset/boot/flash logic. Just connect the board to your host computer | ||
| and run: | ||
| For detailed information about ESP32-S3 as well as configuring and compiling | ||
| RIOT for ESP32-S3 boards, see \ref esp32_riot. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2023 Gunar Schorcht | ||
| * SPDX-FileCopyrightText: 2026 Technische Universität Hamburg | ||
| * SPDX-License-Identifier: LGPL-2.1-only | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| /** | ||
| * @ingroup boards_waveshare-esp32s3-touch-lcd-128 | ||
| * @{ | ||
| * | ||
| * @file | ||
| * @brief Board specific definitions for the Waveshare ESP32-S3 1.28-inch | ||
| * round display board (Touch version) | ||
| * | ||
| * @author Gunar Schorcht <gunar@schorcht.net> | ||
| * @author Yahia Abdella <yahia.abdella@tuhh.de> | ||
| */ | ||
|
|
||
| /** | ||
| * @name Button pin definitions | ||
| * @{ | ||
| */ | ||
|
|
||
| /** | ||
| * @brief Default button GPIO pin definition | ||
| * | ||
| * The board has a BOOT button connected to GPIO0, which can be | ||
| * used as button during normal operation. Since the GPIO0 pin is pulled up, | ||
| * the button signal is inverted, i.e., pressing the button will give a | ||
| * low signal. | ||
| */ | ||
| #define BTN0_PIN GPIO0 | ||
|
|
||
| /** | ||
| * @brief Default button GPIO mode definition | ||
| */ | ||
| #define BTN0_MODE GPIO_IN_PU | ||
|
|
||
| /** | ||
| * @brief Default interrupt flank definition for the button GPIO | ||
| */ | ||
| #ifndef BTN0_INT_FLANK | ||
| # define BTN0_INT_FLANK GPIO_FALLING | ||
| #endif | ||
|
|
||
| /** | ||
| * @brief Definition for compatibility with previous versions | ||
| */ | ||
| #define BUTTON0_PIN BTN0_PIN | ||
|
|
||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name LCD configuration | ||
| * | ||
| * The board features a 240x240 TFT display being driven by a GC9A01 LCD driver | ||
| * The display driver is connected via SPI | ||
| * | ||
| * @{ | ||
| */ | ||
| #if MODULE_GC9A01 | ||
| # define LCD_DC GPIO8 /**< LCD DC signal */ | ||
| # define LCD_CS GPIO9 /**< LCD EN signal */ | ||
| # define LCD_RST GPIO14 /**< LCD RST signal */ | ||
| # define LCD_BACKLIGHT GPIO2 /**< LCD BL signal */ | ||
|
|
||
| # define GC9A01_PARAM_CS LCD_CS | ||
| # define GC9A01_PARAM_DCX LCD_DC | ||
| # define GC9A01_PARAM_RST LCD_RST | ||
| # define GC9A01_PARAM_NUM_LINES 240 | ||
| # define GC9A01_PARAM_RGB_CHANNELS 240 | ||
| # define GC9A01_PARAM_INVERTED 1 | ||
| # define GC9A01_PARAM_RGB 0 | ||
| # ifndef GC9A01_PARAM_ROTATION | ||
| # define GC9A01_PARAM_ROTATION GC9A01_ROTATION_VERT | ||
| # endif | ||
| # ifndef GC9A01_PARAM_SPI_CLK | ||
| # define GC9A01_PARAM_SPI_CLK SPI_CLK_10MHZ | ||
| # endif | ||
|
|
||
| # define BACKLIGHT_ON gpio_set(LCD_BACKLIGHT) | ||
| # define BACKLIGHT_OFF gpio_clear(LCD_BACKLIGHT) | ||
| #endif | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name Touch panel configuration | ||
| * | ||
| * The board features a CST816S touch display driver | ||
| * The touch chip is connected via I2C | ||
| * | ||
| * @{ | ||
| */ | ||
| #if MODULE_CST816S | ||
| # define CST816S_PARAM_I2C_DEV I2C_DEV(0) | ||
| # define CST816S_PARAM_IRQ GPIO5 | ||
| # define CST816S_PARAM_RESET GPIO13 | ||
| #endif | ||
| /** @} */ | ||
|
|
||
| /** | ||
| * @name IMU configuration | ||
| * | ||
| * The board features a QMI8658 interial measurement unit | ||
| * The IMU is connected via I2C | ||
| * | ||
| * @{ | ||
| */ | ||
| #if MODULE_QMI8658 | ||
| # define QMI8658_PARAM_I2C I2C_DEV(0) | ||
| #endif | ||
| /** @} */ | ||
|
|
||
| /* include common board definitions as last step */ | ||
| #include "board_common.h" | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| /** @} */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: 2023 Gunar Schorcht | ||
| * SPDX-License-Identifier: LGPL-2.1-only | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| /** | ||
| * @ingroup boards_waveshare-esp32s3-touch-lcd-128 | ||
| * @brief Board specific configuration of direct mapped GPIOs for the | ||
| * Waveshare ESP32-S3 1.28-inch round display board (Touch | ||
| * version) | ||
| * @file | ||
| * @author Gunar Schorcht <gunar@schorcht.net> | ||
| * @{ | ||
| */ | ||
|
|
||
| #include "board.h" | ||
| #include "saul/periph.h" | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| /** | ||
| * @brief Boot button configuration | ||
| */ | ||
| static const saul_gpio_params_t saul_gpio_params[] = | ||
| { | ||
| { | ||
| .name = "BOOT", | ||
| .pin = BTN0_PIN, | ||
| .mode = BTN0_MODE, | ||
| .flags = SAUL_GPIO_INVERTED | ||
| }, | ||
| }; | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| /** @} */ |
Uh oh!
There was an error while loading. Please reload this page.