boards/xtensa/esp32s3: New board WaveShare ESP32-S3-Touch-LCD-1.28 (WIP).
* Initial experimental / work in progress implementation. * New board name is esp32s3-ws-lcd128. * Supports Kconfig delectable w/wo touch variants (lcd gpios difference). * IMU QMI8658 bringups is put into esp32s3/common/src to share with other boards. Pin defines are located at <board>include/board.h and referenced with `#include <arch/board/board.h>`. * Supported configurations: nsh, ostest, coremark, touch-lvgl, notouch-lvgl, imu-qmi8658, watchdog. * Does not have touch panel driver yet. * Created board documentation. Added sphinx inline cross-references. * TODO: Fix SPI GC9A01A LCD pixel format colors. * TODO: Create I2C CST816S touch panel driver. Signed-off-by: Tomasz 'CeDeROM' CEDRO <tomek@cedro.info>
@@ -1,3 +1,5 @@
|
||||
.. _coremark:
|
||||
|
||||
===============================
|
||||
``coremark`` CoreMark Benchmark
|
||||
===============================
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
.. _lvgldemo:
|
||||
|
||||
======================
|
||||
``lvgldemo`` LVGL Demo
|
||||
======================
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
.. _watchdog:
|
||||
|
||||
``watchdog`` Watchdog Timer
|
||||
===========================
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
.. _lvgl:
|
||||
|
||||
=============
|
||||
``lvgl`` LVGL
|
||||
=============
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
.. _uorb:
|
||||
|
||||
==========================================
|
||||
``uorb`` uorb(micro object request broker)
|
||||
==========================================
|
||||
@@ -532,6 +534,8 @@ and management in an embedded system environment.
|
||||
**Tools**
|
||||
^^^^^^^^^
|
||||
|
||||
.. _uorb_listener:
|
||||
|
||||
**uorb_listener**
|
||||
-----------------
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
.. _ostest:
|
||||
|
||||
==================
|
||||
``ostest`` OS test
|
||||
==================
|
||||
|
||||
@@ -62,6 +62,12 @@ Reusable LCD drivers reside in the drivers/lcd directory:
|
||||
LCDs
|
||||
----
|
||||
|
||||
.. _gc9a01:
|
||||
|
||||
- ``gc9a01.c``
|
||||
|
||||
GalaxyCore GC9A01 TFT LCD controller.
|
||||
|
||||
- ``mio283qt2.c``
|
||||
|
||||
This is a driver for the MI0283QT-2 LCD from Multi-Inno
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
.. _qmi8658:
|
||||
|
||||
=======
|
||||
QMI8658
|
||||
=======
|
||||
|
||||
|
After Width: | Height: | Size: 235 KiB |
|
After Width: | Height: | Size: 121 KiB |
|
After Width: | Height: | Size: 156 KiB |
|
After Width: | Height: | Size: 179 KiB |
|
After Width: | Height: | Size: 175 KiB |
|
After Width: | Height: | Size: 84 KiB |
|
After Width: | Height: | Size: 171 KiB |
|
After Width: | Height: | Size: 52 KiB |
@@ -0,0 +1,407 @@
|
||||
=================
|
||||
ESP32S3-WS-LCD128
|
||||
=================
|
||||
|
||||
.. tags:: chip:esp32s3
|
||||
|
||||
.. figure:: ESP32-S3-Touch-LCD-1.28.jpg
|
||||
:align: center
|
||||
|
||||
This board definition is a starting point for development with
|
||||
`ESP32-S3-LCD-1.28 <https://www.waveshare.com/esp32-s3-lcd-1.28.htm>`__ and
|
||||
`ESP32-S3-Touch-LCD-1.28 <https://www.waveshare.com/esp32-s3-touch-lcd-1.28.htm>`__
|
||||
which are low-cost ($16/$22) open-source hardware designed by
|
||||
`WaveShare <https://www.waveshare.com/>`_. High-performance Xtensa based
|
||||
ESP32-S3 MCU, small size, onboard round 1.28" LCD display, capacitive touch
|
||||
screen (Touch version only), Li-ion accumulator charge manager, 6-axis sensor
|
||||
(3-axis accelerometer and 3-axis gyroscope), and quick module attachmend
|
||||
1.27mm connectors (non-Touch version only), makes it a perfect candidate
|
||||
for integration into your projects and products quickly.
|
||||
|
||||
.. list-table::
|
||||
:width: 100%
|
||||
:class: borderless
|
||||
|
||||
* - .. figure:: ESP32-S3-LCD-1.28-details-intro.jpg
|
||||
:target: https://www.waveshare.com/wiki/ESP32-S3-LCD-1.28
|
||||
:align: center
|
||||
|
||||
ESP32-S3-LCD-1.28.
|
||||
|
||||
- .. figure:: ESP32-S3-Touch-LCD-1.28-details-intro.jpg
|
||||
:target: https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-1.28
|
||||
:align: center
|
||||
|
||||
ESP32-S3-Touch-LCD-1.28.
|
||||
|
||||
These boards are almost identical. Touch version has touch screen,
|
||||
while non-Touch version has two connectors exposing more GPIOs at the bottom,
|
||||
thus slightly different signal routes. See Pinouts and GPIO sections below
|
||||
for details.
|
||||
|
||||
Because of that similarity, a single board definition is provided by NuttX,
|
||||
while features and configuration details are build time Kconfig selectable:
|
||||
|
||||
* ``CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_TOUCH`` selects Touch variant.
|
||||
* ``CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_NOTOUCH`` selects Non-Touch variant.
|
||||
|
||||
Both boards are based on existing :ref:`esp32s3` chip implementation.
|
||||
WaveShare WIKI contains board details, generic examples, documentation, and
|
||||
schematics for the
|
||||
`ESP32-S3-LCD-1.28 <https://www.waveshare.com/wiki/ESP32-S3-LCD-1.28>`__ and
|
||||
`ESP32-S3-Touch-LCD-1.28 <https://www.waveshare.com/wiki/ESP32-S3-Touch-LCD-1.28>`__.
|
||||
|
||||
.. note:: Implementation is experimental and still early stage of development!
|
||||
|
||||
|
||||
Features
|
||||
========
|
||||
|
||||
- ESP32-S3R2 Xtensa® 32-bit LX7 dual-core processor, up to 240MHz frequency.
|
||||
- 2.4GHz Wi-Fi (802.11 b/g/n) and Bluetooth® 5 (BLE) with onboard antenna.
|
||||
- Built in 512KB of SRAM and 384KB ROM, on-chip 2MB PSRAM, external 16MB
|
||||
W25Q128JVSIQ NOR Flash memory.
|
||||
- USB-C connector and CH343P USB-to-UART converter (flashing, console).
|
||||
- Onboard GC9A01A controlled round 1.28" 240×240 resolution 65K color LCD.
|
||||
- Onboard QMI8658 6-axis IMU (3-axis accelerometer and 3-axis gyroscope).
|
||||
- Onboard 3.7V MX1.25 lithium battery re/discharge header, ETA6096 charger.
|
||||
- Touch version:
|
||||
|
||||
- CST816S capacitive touch display controller.
|
||||
- 6 × GPIO exposed over SH1.0 connector.
|
||||
|
||||
- Non-Touch version:
|
||||
|
||||
- 32 x GPIO exposed over 2 x 2x10 1.27mm female connectors.
|
||||
|
||||
|
||||
Dimensions
|
||||
==========
|
||||
|
||||
- ESP32-S3-LCD-1.28:
|
||||
|
||||
.. figure:: ESP32-S3-LCD-1.28-details-size.jpg
|
||||
:align: center
|
||||
|
||||
- ESP32-S3-Touch-LCD-1.28:
|
||||
|
||||
.. figure:: ESP32-S3-Touch-LCD-1.28-details-size-1.jpg
|
||||
:align: center
|
||||
|
||||
.. figure:: ESP32-S3-Touch-LCD-1.28-details-size-2.jpg
|
||||
:align: center
|
||||
|
||||
|
||||
Pinouts
|
||||
=======
|
||||
|
||||
- ESP32-S3-LCD-1.28:
|
||||
|
||||
.. figure:: ESP32-S3-LCD-1.28-details-inter.jpg
|
||||
:align: center
|
||||
|
||||
- ESP32-S3-Touch-LCD-1.28:
|
||||
|
||||
.. figure:: ESP32-S3-Touch-LCD-1.28-details-inter.jpg
|
||||
:align: center
|
||||
|
||||
|
||||
GPIO
|
||||
====
|
||||
|
||||
.. warning:: ESP32-S3-LCD-1.28 pinout on the picture above is different from
|
||||
the schematics (picture has H2 rotated numbering but the signal
|
||||
names are valid)! Schematics and table below shows correct data.
|
||||
Issue is reported to vendor, we are waiting for the fix / update.
|
||||
|
||||
+------------+----------------------+-------------------------+
|
||||
| ESP32-S3R2 | ESP32-S3-LCD-1.28 | ESP32-S3-Touch-LCD-1.28 |
|
||||
+============+======================+=========================+
|
||||
| GND | H1.20, H2.1, H2.2 | P2.1, P2.5 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| VSYS(USB5V)| H1.18, H2.3 | P2.2 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| 3V3 | BAT_ADC / H2.4 | P2.6 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| CHIP_PU | RUN/RESET / H2.8 | RUN/RESET / P2.3 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO0 | BOOT / H2.6, H2.10 | BOOT / P2.4 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO1 | BAT_ADC / H2.12 | BAT_ADC / P2.6 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO2 | GPIO2 / H2.14 | LCD_BL |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO3 | GPIO3 / H2.16 | IMU_INT2 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO4 | GPIO4 / H2.18 | IMU_INT1 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO5 | GPIO5 / H2.20 | TP_INT |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO6 | IMU_SDA / H2.5 | IMU_SDA,TP_SDA |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO7 | IMU_SCL / H2.7 | IMU_SCL,TP_SCL |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO8 | LCD_DC / H2.9 | LCD_DC |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO9 | LCD_CS / H2.11 | LCD_CS |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO10 | LCD_CLK / H2.13 | CLD_CLK |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO11 | LCD_DIN / H2.15 | LCD_MOSI |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO12 | LCD_RST / H2.17 | LCD_MISO |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO13 | GPIO13 / H2.19 | TP_RST |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO14 | GPIO14 / H1.19 | LCD_RST |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO15 | GPIO15 / H1.17 | GPIO15 / P2.7 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO16 | GPIO16 / H1.15 | GPIO16 / P2.8 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO17 | GPIO17 / H1.13 | GPIO17 / P2.9 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO18 | GPIO18 / H1.11 | GPIO18 / P2.10 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO21 | GPIO21 / H1.9 | GPIO21 / P2.11 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO33 | GPIO33 / H1.7 | GPIO33 / P2.12 |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO34 | GPIO34 / H1.5 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO35 | GPIO35 / H1.3 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO36 | GPIO36 / H1.1 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO37 | GPIO37 / H1.16 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO38 | GPIO38 / H1.14 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO39 | GPIO39 / H1.12 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO40 | LCD_BL / H1.10 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO41 | GPIO41 / H1.8 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO42 | GPIO42 / H1.6 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO45 | GPIO45 / H1.4 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO46 | GPIO46 / H1.2 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO47 | IMU_INT1 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
| GPIO48 | IMU_INT2 | |
|
||||
+------------+----------------------+-------------------------+
|
||||
|
||||
Board Buttons
|
||||
-------------
|
||||
|
||||
There are two buttons labeled BOOT and RESET (both are exposed on board
|
||||
connectors):
|
||||
|
||||
* RESET (active low) button is not available to the software and can be used
|
||||
as manual hardware reset trigger.
|
||||
|
||||
* BOOT button is connected to GPIO0. On reset/power-on it can be used to
|
||||
trigger BootROM serial bootloader when pressed (active low) in order to
|
||||
flash new firmware. After reset BOOT button can be used as software input.
|
||||
|
||||
|
||||
|
||||
Serial Console
|
||||
==============
|
||||
|
||||
UART0 is by default used for the serial console. It connects to the on-board
|
||||
CH343P converter and is available on the USB-C connector that can be also used
|
||||
for firmware flashing.
|
||||
|
||||
|
||||
Configurations
|
||||
==============
|
||||
|
||||
All of the available configurations provide basic testing utilities or serve
|
||||
as an example starting point for your own projects.
|
||||
Use them by running the following commands::
|
||||
|
||||
$ ./tools/configure.sh esp32s3-ws-lcd128:<config_name>
|
||||
$ make flash -j ESPTOOL_PORT=<serial_port_device>
|
||||
|
||||
Notes:
|
||||
|
||||
- ``<config_name>`` is the name of board configuration you want to use
|
||||
(i.e. nsh, lvgl). Then use a serial console terminal like ``cu`` or
|
||||
``minicom`` configured to 115200 8N1.
|
||||
- ``<serial_port_device>`` is usually ``/dev/ttyUSB0`` or ``/dev/cuaU0``
|
||||
depending on the OS you are using.
|
||||
- On BSD systems use GNU Make (``gmake``) in place of ``make``.
|
||||
|
||||
coremark
|
||||
--------
|
||||
|
||||
Provides :ref:`coremark <CoreMark>` benchmarking utility on boot::
|
||||
|
||||
Running CoreMark...
|
||||
2K performance run parameters for coremark.
|
||||
CoreMark Size : 666
|
||||
Total ticks : 2313
|
||||
Total time (secs): 23.130000
|
||||
Iterations/Sec : 951.145698
|
||||
Iterations : 22000
|
||||
Compiler version : GCC14.2.0
|
||||
Compiler flags : -O3 -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-strength-reduce
|
||||
Parallel PThreads : 2
|
||||
Memory location : HEAP
|
||||
seedcrc : 0xe9f5
|
||||
[0]crclist : 0xe714
|
||||
[1]crclist : 0xe714
|
||||
[0]crcmatrix : 0x1fd7
|
||||
[1]crcmatrix : 0x1fd7
|
||||
[0]crcstate : 0x8e3a
|
||||
[1]crcstate : 0x8e3a
|
||||
[0]crcfinal : 0x33ff
|
||||
[1]crcfinal : 0x33ff
|
||||
Correct operation validated. See README.md for run and reporting rules.
|
||||
CoreMark 1.0 : 951.145698 / GCC14.2.0 -O3 -fno-strict-aliasing -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-strength-reduce / HEAP / 2:PThreads
|
||||
|
||||
notouch-lvgl
|
||||
------------
|
||||
|
||||
This is a demonstration of the :ref:`lvgl <lvgl>` graphics library running on the
|
||||
NuttX's :ref:`GC9A01A <gc9a01>` LCD driver. Demo will launch itself on boot
|
||||
and you should see it on the screen right away.
|
||||
This configuration uses the :ref:`lvgldemo <lvgldemo>` application.
|
||||
|
||||
.. note::
|
||||
|
||||
1. This configuration has ``CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_NOTOUCH``
|
||||
set. It selects LCD pins valid for the Non-Touch board variant.
|
||||
|
||||
2. Colors are invalid. Pixel format to be fixed. Work in progress.
|
||||
|
||||
nsh
|
||||
---
|
||||
|
||||
Provides :ref:`nsh <nsh>` NuttShell as default application.
|
||||
Console runs on UART0 at 115200bps and is exposed via USB over CH343P chip.
|
||||
|
||||
qmi8658
|
||||
-------
|
||||
|
||||
Provides onboard :ref:`QMI8658` IMU and internal ESP32S3 temperature
|
||||
:ref:`uorb <uorb>` sensors example. Sensors are registered under
|
||||
``/dev/urob/`` and its data can be obtained with :ref:`uorb_listener`
|
||||
application::
|
||||
|
||||
nsh> ls /dev/uorb
|
||||
/dev/uorb:
|
||||
sensor_accel0
|
||||
sensor_gyro0
|
||||
sensor_temp0
|
||||
|
||||
nsh> uorb_listener -n 10
|
||||
|
||||
Monitor objects num:3
|
||||
object_name:sensor_temp, object_instance:0
|
||||
object_name:sensor_gyro, object_instance:0
|
||||
object_name:sensor_accel, object_instance:0
|
||||
sensor_temp(now:144950000):timestamp:144950000,temperature:36.000000
|
||||
sensor_temp(now:145960000):timestamp:145960000,temperature:37.000000
|
||||
sensor_gyro(now:145960000):timestamp:145960000,x:-4.750000,y:-0.437500,z:0.156250,temperature:32.261719
|
||||
sensor_accel(now:145960000):timestamp:145960000,x:0.031250,y:-0.088867,z:-1.051392,temperature:32.261719
|
||||
sensor_temp(now:146970000):timestamp:146970000,temperature:37.000000
|
||||
sensor_gyro(now:146970000):timestamp:146970000,x:-4.937500,y:-0.562500,z:0.218750,temperature:32.281250
|
||||
sensor_accel(now:146970000):timestamp:146970000,x:0.031738,y:-0.088623,z:-1.046265,temperature:32.281250
|
||||
sensor_temp(now:147980000):timestamp:147980000,temperature:37.000000
|
||||
sensor_gyro(now:147980000):timestamp:147980000,x:-4.750000,y:0.031250,z:0.437500,temperature:32.273438
|
||||
sensor_accel(now:147980000):timestamp:147980000,x:0.031005,y:-0.088745,z:-1.049683,temperature:32.273438
|
||||
Object name:sensor_temp0, received:4
|
||||
Object name:sensor_gyro0, received:3
|
||||
Object name:sensor_accel0, received:3
|
||||
Total number of received Message:10/10
|
||||
|
||||
ostest
|
||||
------
|
||||
|
||||
Provides :ref:`ostest <ostest>` NuttX self-test utility::
|
||||
|
||||
nsh> ostest
|
||||
stdio_test: write fd=1
|
||||
stdio_test: Standard I/O Check: printf
|
||||
stdio_test: write fd=2
|
||||
stdio_test: Standard I/O Check: fprintf to stderr
|
||||
ostest_main: putenv(Variable1=BadValue3)
|
||||
ostest_main: setenv(Variable1, GoodValue1, TRUE)
|
||||
ostest_main: setenv(Variable2, BadValue1, FALSE)
|
||||
ostest_main: setenv(Variable2, GoodValue2, TRUE)
|
||||
ostest_main: setenv(Variable3, GoodValue3, FALSE)
|
||||
ostest_main: setenv(Variable3, BadValue2, FALSE)
|
||||
show_variable: Variable=Variable1 has value=GoodValue1
|
||||
show_variable: Variable=Variable2 has value=GoodValue2
|
||||
show_variable: Variable=Variable3 has value=GoodValue3
|
||||
ostest_main: Started user_main at PID=3
|
||||
|
||||
(..)
|
||||
|
||||
End of test memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 5d378 5d378
|
||||
ordblks 5 5
|
||||
mxordblk 542d0 542d0
|
||||
uordblks 47e8 47e8
|
||||
fordblks 58b90 58b90
|
||||
|
||||
Final memory usage:
|
||||
VARIABLE BEFORE AFTER
|
||||
======== ======== ========
|
||||
arena 5d378 5d378
|
||||
ordblks 1 5
|
||||
mxordblk 58c28 542d0
|
||||
uordblks 4750 47e8
|
||||
fordblks 58c28 58b90
|
||||
user_main: Exiting
|
||||
ostest_main: Exiting with status 0
|
||||
|
||||
touch-lvgl
|
||||
----------
|
||||
|
||||
This is a demonstration of the :ref:`lvgl <lvgl>` graphics library running on the
|
||||
NuttX's :ref:`GC9A01A <gc9a01>` LCD driver. Demo will launch itself on boot and you
|
||||
should see it on the screen right away.
|
||||
This configuration uses the :ref:`lvgldemo <lvgldemo>` application.
|
||||
|
||||
.. note::
|
||||
|
||||
1. This configuration has ``CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_TOUCH``
|
||||
set. It selects LCD pins valid for the Touch board variant.
|
||||
|
||||
2. Colors are invalid. Pixel format to be fixed. Work in progress.
|
||||
|
||||
3. Touch screen driver (I2C/CST816S) is not yet implemented!
|
||||
Work in progress.
|
||||
|
||||
watchdog
|
||||
--------
|
||||
|
||||
Provides :ref:`watchdog <watchdog>` testing utility::
|
||||
|
||||
nsh> wdog
|
||||
ping elapsed=0
|
||||
ping elapsed=500
|
||||
ping elapsed=1000
|
||||
ping elapsed=1500
|
||||
ping elapsed=2000
|
||||
ping elapsed=2500
|
||||
ping elapsed=3000
|
||||
ping elapsed=3500
|
||||
ping elapsed=4000
|
||||
ping elapsed=4500
|
||||
NO ping elapsed=5000
|
||||
NO ping elapsed=5500
|
||||
NO ping elapsed=6000
|
||||
|
||||
ESP-ROM:esp32s3-20210327
|
||||
Build:Mar 27 2021
|
||||
rst:0x7 (TG0WDT_SYS_RST),boot:0x18 (SPI_FAST_FLASH_BOOT)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
.. _esp32s3:
|
||||
|
||||
==================
|
||||
Espressif ESP32-S3
|
||||
==================
|
||||
|
||||
@@ -597,6 +597,35 @@ config ARCH_BOARD_ESP32S3_LCKFB_SZPI
|
||||
select ARCH_HAVE_BUTTONS
|
||||
select ARCH_HAVE_IRQBUTTONS if ESPRESSIF_GPIO_IRQ
|
||||
|
||||
config ARCH_BOARD_ESP32S3_WS_LCD128
|
||||
bool "WaveShare ESP32-S3-(Touch)-LCD-1.28"
|
||||
depends on ARCH_CHIP_ESP32S3CUSTOM
|
||||
select ESP32S3_UART0
|
||||
select ESP32S3_SPI2
|
||||
select SPI_CMDDATA
|
||||
select LCD
|
||||
select LCD_DEV
|
||||
select LCD_GC9A01
|
||||
---help---
|
||||
This board comes in two variants:
|
||||
1. Touch screen marked ESP32-S3-Touch-LCD-1.28 [1].
|
||||
2. No-Touch marked ESP32-S3-LCD-1.28 [2].
|
||||
|
||||
WaveShare ESP32-S3-(Touch)-LCD-1.28 board uses up to 240MHz dual core LX7
|
||||
32-bit ESP32-S3R2 SoC with WiFi (802.11b/g/n) and Bluetooth 5 (LE) using
|
||||
onboard antenna, 512KB SRAM, 384KB ROM, onboard 2MB PSRAM, external 16MB
|
||||
NOR Flash (W25Q128JVSIQ). Flashing and console over CH434P UART-to-USB-C.
|
||||
Board is equipped with round 240x240 GCA01 65K color SPI LCD, CST819 I2C
|
||||
touch screen (touch variant), QMI8658 6-axis IMU, ETA6096 3.7V lithium
|
||||
charger (MX1.25 connector), reset and boot buttons.
|
||||
|
||||
Touch variant provides 6 GPIO over SH-1.0 12 pin connector (goldpin ended
|
||||
cable attached). Non-touch variant provides two 2x10 1.27mm female board
|
||||
connectors.
|
||||
|
||||
[1] www.waveshare.com/esp32-s3-lcd-1.28.htm
|
||||
[2] www.waveshare.com/esp32-s3-touch-lcd-1.28.htm
|
||||
|
||||
config ARCH_BOARD_ESP32C6_DEVKITC
|
||||
bool "Espressif ESP32-C6-DevKitC-1"
|
||||
depends on ARCH_CHIP_ESP32C6WROOM1
|
||||
@@ -3628,6 +3657,7 @@ config ARCH_BOARD
|
||||
default "esp32s3-box" if ARCH_BOARD_ESP32S3_BOX
|
||||
default "esp32s3-korvo-2" if ARCH_BOARD_ESP32S3_KORVO_2
|
||||
default "lckfb-szpi-esp32s3" if ARCH_BOARD_ESP32S3_LCKFB_SZPI
|
||||
default "esp32s3-ws-lcd128" if ARCH_BOARD_ESP32S3_WS_LCD128
|
||||
default "esp32c6-devkitc" if ARCH_BOARD_ESP32C6_DEVKITC
|
||||
default "esp32c6-devkitm" if ARCH_BOARD_ESP32C6_DEVKITM
|
||||
default "esp32c6-xiao" if ARCH_BOARD_ESP32C6_XIAO
|
||||
@@ -4917,6 +4947,9 @@ endif
|
||||
if ARCH_BOARD_ESP32S3_LHCBIT
|
||||
source "boards/xtensa/esp32s3/esp32s3-lhcbit/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_ESP32S3_WS_LCD128
|
||||
source "boards/xtensa/esp32s3/esp32s3-ws-lcd128/Kconfig"
|
||||
endif
|
||||
if ARCH_BOARD_ESP32S3_XIAO
|
||||
source "boards/xtensa/esp32s3/esp32s3-xiao/Kconfig"
|
||||
endif
|
||||
|
||||
@@ -74,6 +74,10 @@ ifeq ($(CONFIG_ESPRESSIF_ADC),y)
|
||||
CSRCS += esp32s3_board_adc.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SENSORS_QMI8658),y)
|
||||
CSRCS += esp32s3_qmi8658.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NET_LAN9250),y)
|
||||
CSRCS += esp32s3_lan9250.c
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/****************************************************************************
|
||||
* boards/xtensa/esp32s3/common/src/esp32s3_qmi8658.c
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <debug.h>
|
||||
#include <assert.h>
|
||||
#include <arch/board/board.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/sensors/qmi8658.h>
|
||||
|
||||
#include "esp32s3_i2c.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_qmi8658_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the QMI8658 6-axis IMU sensor driver.
|
||||
*
|
||||
* This function registers the uORB interface which creates:
|
||||
* - "/dev/uorb/sensor_accel0" for accelerometer data
|
||||
* - "/dev/uorb/sensor_gyro0" for gyroscope data
|
||||
*
|
||||
* This driver initialization expects defines at <board>/include/board.h:
|
||||
* 1. QMI8658_I2C_PORT: I2C port used (remember to configure pins).
|
||||
* 2. QMI8658_I2C_ADDR: chip address (0x6B for SA0=0 or 0x6A for SA0=1).
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) on success; a negated errno value on failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int esp32s3_qmi8658_initialize(void)
|
||||
{
|
||||
struct i2c_master_s *i2c;
|
||||
int ret;
|
||||
|
||||
/* Initialize I2C bus */
|
||||
|
||||
i2c = esp32s3_i2cbus_initialize(QMI8658_I2C_PORT);
|
||||
if (!i2c)
|
||||
{
|
||||
i2cerr("Initialize I2C bus failed!\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Register QMI8658 uORB sensor device */
|
||||
|
||||
ret = qmi8658_uorb_register(0, i2c, QMI8658_I2C_ADDR);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to register QMI8658 uORB driver: %d\n", ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
#
|
||||
# For a description of the syntax of this configuration file,
|
||||
# see the file kconfig-language.txt in the NuttX tools repository.
|
||||
#
|
||||
|
||||
if ARCH_BOARD_ESP32S3_WS_LCD128
|
||||
|
||||
choice
|
||||
prompt "BOARD VARIANT"
|
||||
default ARCH_BOARD_ESP32S3_WS_LCD128_NOTOUCH
|
||||
---help---
|
||||
There are two variants of the board with [1] and without [2] touch screen.
|
||||
These boards also have slightly different signals and capabilities.
|
||||
Non-touch variant has two connectors with many more GPIO available.
|
||||
|
||||
[1] https://www.waveshare.com/esp32-s3-touch-lcd-1.28.htm
|
||||
[2] https://www.waveshare.com/esp32-s3-lcd-1.28.htm
|
||||
|
||||
NOTE: Touch screen driver is not yet implemented!
|
||||
|
||||
config ARCH_BOARD_ESP32S3_WS_LCD128_NOTOUCH
|
||||
bool "NO-TOUCH ESP32-S3-LCD-1.28"
|
||||
select LCD
|
||||
---help---
|
||||
Mark this choice if your board has no touch screen module installed.
|
||||
www.waveshare.com/esp32-s3-lcd-1.28.htm
|
||||
|
||||
config ARCH_BOARD_ESP32S3_WS_LCD128_TOUCH
|
||||
bool "TOUCH ESP32-S3-Touch-LCD-1.28"
|
||||
---help---
|
||||
Mark this choice if your board has touch screen module installed.
|
||||
www.waveshare.com/esp32-s3-touch-lcd-1.28.htm
|
||||
|
||||
NOTE: Touch screen driver is not yet implemented!
|
||||
|
||||
endchoice
|
||||
|
||||
endif # ARCH_BOARD_ESP32S3_WS_LCD128
|
||||
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NDEBUG is not set
|
||||
CONFIG_ARCH="xtensa"
|
||||
CONFIG_ARCH_BOARD="esp32s3-ws-lcd128"
|
||||
CONFIG_ARCH_BOARD_COMMON=y
|
||||
CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128=y
|
||||
CONFIG_ARCH_CHIP="esp32s3"
|
||||
CONFIG_ARCH_CHIP_ESP32S3=y
|
||||
CONFIG_ARCH_CHIP_ESP32S3CUSTOM=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_IRQ_TO_NDX=y
|
||||
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
|
||||
CONFIG_ARCH_NUSER_INTERRUPTS=2
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH_XTENSA=y
|
||||
CONFIG_BENCHMARK_COREMARK=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_DEBUG_CUSTOMOPT=y
|
||||
CONFIG_DEBUG_OPTLEVEL="-O3"
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=3072
|
||||
CONFIG_INIT_ENTRYPOINT="coremark_main"
|
||||
CONFIG_INIT_STACKSIZE=3072
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_RAM_SIZE=114688
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_SMP_NCPUS=2
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
CONFIG_START_YEAR=2011
|
||||
CONFIG_SYSLOG_BUFFER=y
|
||||
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||
@@ -0,0 +1,65 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ARCH="xtensa"
|
||||
CONFIG_ARCH_BOARD="esp32s3-ws-lcd128"
|
||||
CONFIG_ARCH_BOARD_COMMON=y
|
||||
CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128=y
|
||||
CONFIG_ARCH_CHIP="esp32s3"
|
||||
CONFIG_ARCH_CHIP_ESP32S3=y
|
||||
CONFIG_ARCH_CHIP_ESP32S3CUSTOM=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_IRQ_TO_NDX=y
|
||||
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
|
||||
CONFIG_ARCH_NUSER_INTERRUPTS=2
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH_XTENSA=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_DEBUG_UORB=y
|
||||
CONFIG_ESP32S3_I2C0=y
|
||||
CONFIG_ESP32S3_I2C0_SCLPIN=7
|
||||
CONFIG_ESP32S3_I2C0_SDAPIN=6
|
||||
CONFIG_ESPRESSIF_TEMP=y
|
||||
CONFIG_ESPRESSIF_TEMP_UORB=y
|
||||
CONFIG_ESPRESSIF_TEMP_UORB_POLL=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=3072
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
CONFIG_INIT_STACKSIZE=3072
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LINE_MAX=64
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
CONFIG_NSH_READLINE=y
|
||||
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_SENSORS=y
|
||||
CONFIG_SENSORS_QMI8658=y
|
||||
CONFIG_SENSORS_QMI8658_POLL=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
CONFIG_START_YEAR=2011
|
||||
CONFIG_SYSLOG_BUFFER=y
|
||||
CONFIG_SYSTEM_I2CTOOL=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||
CONFIG_UORB=y
|
||||
CONFIG_UORB_LISTENER=y
|
||||
CONFIG_UORB_STACKSIZE=4096
|
||||
CONFIG_USENSOR=y
|
||||
@@ -0,0 +1,74 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ARCH="xtensa"
|
||||
CONFIG_ARCH_BOARD="esp32s3-ws-lcd128"
|
||||
CONFIG_ARCH_BOARD_COMMON=y
|
||||
CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128=y
|
||||
CONFIG_ARCH_CHIP="esp32s3"
|
||||
CONFIG_ARCH_CHIP_ESP32S3=y
|
||||
CONFIG_ARCH_CHIP_ESP32S3CUSTOM=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_IRQ_TO_NDX=y
|
||||
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
|
||||
CONFIG_ARCH_NUSER_INTERRUPTS=2
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH_XTENSA=y
|
||||
CONFIG_BOARD_INITTHREAD_STACKSIZE=8192
|
||||
CONFIG_BOARD_LATE_INITIALIZE=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_ESP32S3_DMA=y
|
||||
CONFIG_ESP32S3_PSRAM_2M=y
|
||||
CONFIG_ESP32S3_SPEED_UP_ISR=y
|
||||
CONFIG_ESP32S3_SPI2_CLKPIN=10
|
||||
CONFIG_ESP32S3_SPI2_CSPIN=9
|
||||
CONFIG_ESP32S3_SPI2_MISOPIN=12
|
||||
CONFIG_EXAMPLES_LVGLDEMO=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_GRAPHICS_LVGL=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=8192
|
||||
CONFIG_INIT_ENTRYPOINT="lvgldemo_main"
|
||||
CONFIG_INIT_STACKSIZE=16384
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LCD_FRAMEBUFFER=y
|
||||
CONFIG_LCD_GC9A01_BGR=y
|
||||
CONFIG_LCD_GC9A01_FREQUENCY=50000000
|
||||
CONFIG_LCD_PORTRAIT=y
|
||||
CONFIG_LINE_MAX=64
|
||||
CONFIG_LV_FONT_MONTSERRAT_20=y
|
||||
CONFIG_LV_USE_CLIB_MALLOC=y
|
||||
CONFIG_LV_USE_CLIB_SPRINTF=y
|
||||
CONFIG_LV_USE_CLIB_STRING=y
|
||||
CONFIG_LV_USE_DEMO_WIDGETS=y
|
||||
CONFIG_LV_USE_LOG=y
|
||||
CONFIG_LV_USE_NUTTX=y
|
||||
CONFIG_LV_USE_NUTTX_LCD=y
|
||||
CONFIG_MM_REGIONS=2
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_RAM_SIZE=114688
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_LPWORK=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SPI_DRIVER=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
CONFIG_START_YEAR=2011
|
||||
CONFIG_SYSLOG_BUFFER=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||
@@ -0,0 +1,47 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_ESP32S3_RTC is not set
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ARCH="xtensa"
|
||||
CONFIG_ARCH_BOARD="esp32s3-ws-lcd128"
|
||||
CONFIG_ARCH_BOARD_COMMON=y
|
||||
CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128=y
|
||||
CONFIG_ARCH_CHIP="esp32s3"
|
||||
CONFIG_ARCH_CHIP_ESP32S3=y
|
||||
CONFIG_ARCH_CHIP_ESP32S3CUSTOM=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_IRQ_TO_NDX=y
|
||||
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
|
||||
CONFIG_ARCH_NUSER_INTERRUPTS=2
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH_XTENSA=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=3072
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
CONFIG_INIT_STACKSIZE=3072
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LINE_MAX=64
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_RAM_SIZE=114688
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_START_DAY=23
|
||||
CONFIG_START_YEAR=2026
|
||||
CONFIG_SYSLOG_BUFFER=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||
@@ -0,0 +1,50 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ARCH="xtensa"
|
||||
CONFIG_ARCH_BOARD="esp32s3-ws-lcd128"
|
||||
CONFIG_ARCH_BOARD_COMMON=y
|
||||
CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128=y
|
||||
CONFIG_ARCH_CHIP="esp32s3"
|
||||
CONFIG_ARCH_CHIP_ESP32S3=y
|
||||
CONFIG_ARCH_CHIP_ESP32S3CUSTOM=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_IRQ_TO_NDX=y
|
||||
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
|
||||
CONFIG_ARCH_NUSER_INTERRUPTS=2
|
||||
CONFIG_ARCH_SETJMP_H=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH_XTENSA=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=3072
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
CONFIG_INIT_STACKSIZE=3072
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LINE_MAX=64
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_RAM_SIZE=114688
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_THREAD_LOCAL=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
CONFIG_START_YEAR=2011
|
||||
CONFIG_SYSLOG_BUFFER=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_TESTING_OSTEST=y
|
||||
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||
@@ -0,0 +1,75 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ARCH="xtensa"
|
||||
CONFIG_ARCH_BOARD="esp32s3-ws-lcd128"
|
||||
CONFIG_ARCH_BOARD_COMMON=y
|
||||
CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128=y
|
||||
CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_TOUCH=y
|
||||
CONFIG_ARCH_CHIP="esp32s3"
|
||||
CONFIG_ARCH_CHIP_ESP32S3=y
|
||||
CONFIG_ARCH_CHIP_ESP32S3CUSTOM=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_IRQ_TO_NDX=y
|
||||
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
|
||||
CONFIG_ARCH_NUSER_INTERRUPTS=2
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH_XTENSA=y
|
||||
CONFIG_BOARD_INITTHREAD_STACKSIZE=8192
|
||||
CONFIG_BOARD_LATE_INITIALIZE=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_ESP32S3_DMA=y
|
||||
CONFIG_ESP32S3_PSRAM_2M=y
|
||||
CONFIG_ESP32S3_SPEED_UP_ISR=y
|
||||
CONFIG_ESP32S3_SPI2_CLKPIN=10
|
||||
CONFIG_ESP32S3_SPI2_CSPIN=9
|
||||
CONFIG_ESP32S3_SPI2_MISOPIN=12
|
||||
CONFIG_EXAMPLES_LVGLDEMO=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_GRAPHICS_LVGL=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=8192
|
||||
CONFIG_INIT_ENTRYPOINT="lvgldemo_main"
|
||||
CONFIG_INIT_STACKSIZE=16384
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LCD_FRAMEBUFFER=y
|
||||
CONFIG_LCD_GC9A01_BGR=y
|
||||
CONFIG_LCD_GC9A01_FREQUENCY=50000000
|
||||
CONFIG_LCD_PORTRAIT=y
|
||||
CONFIG_LINE_MAX=64
|
||||
CONFIG_LV_FONT_MONTSERRAT_20=y
|
||||
CONFIG_LV_USE_CLIB_MALLOC=y
|
||||
CONFIG_LV_USE_CLIB_SPRINTF=y
|
||||
CONFIG_LV_USE_CLIB_STRING=y
|
||||
CONFIG_LV_USE_DEMO_WIDGETS=y
|
||||
CONFIG_LV_USE_LOG=y
|
||||
CONFIG_LV_USE_NUTTX=y
|
||||
CONFIG_LV_USE_NUTTX_LCD=y
|
||||
CONFIG_MM_REGIONS=2
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_RAM_SIZE=114688
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_LPWORK=y
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SPI_DRIVER=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
CONFIG_START_YEAR=2011
|
||||
CONFIG_SYSLOG_BUFFER=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||
@@ -0,0 +1,54 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_NSH_ARGCAT is not set
|
||||
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
|
||||
CONFIG_ARCH="xtensa"
|
||||
CONFIG_ARCH_BOARD="esp32s3-ws-lcd128"
|
||||
CONFIG_ARCH_BOARD_COMMON=y
|
||||
CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128=y
|
||||
CONFIG_ARCH_CHIP="esp32s3"
|
||||
CONFIG_ARCH_CHIP_ESP32S3=y
|
||||
CONFIG_ARCH_CHIP_ESP32S3CUSTOM=y
|
||||
CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_IRQ_TO_NDX=y
|
||||
CONFIG_ARCH_MINIMAL_VECTORTABLE_DYNAMIC=y
|
||||
CONFIG_ARCH_NUSER_INTERRUPTS=2
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH_XTENSA=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=16717
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DEBUG_FULLOPT=y
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_ESP32S3_MWDT0=y
|
||||
CONFIG_ESP32S3_MWDT1=y
|
||||
CONFIG_ESP32S3_RWDT=y
|
||||
CONFIG_EXAMPLES_WATCHDOG=y
|
||||
CONFIG_FS_PROCFS=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=3072
|
||||
CONFIG_INIT_ENTRYPOINT="nsh_main"
|
||||
CONFIG_INIT_STACKSIZE=3072
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LINE_MAX=64
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_FILEIOSIZE=512
|
||||
CONFIG_NSH_READLINE=y
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_RAM_SIZE=114688
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_START_DAY=6
|
||||
CONFIG_START_MONTH=12
|
||||
CONFIG_START_YEAR=2011
|
||||
CONFIG_SYSLOG_BUFFER=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_UART0_SERIAL_CONSOLE=y
|
||||
CONFIG_WATCHDOG=y
|
||||
@@ -0,0 +1,59 @@
|
||||
/****************************************************************************
|
||||
* boards/xtensa/esp32s3/esp32s3-ws-lcd128/include/board.h
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_XTENSA_ESP32S3_ESP32S3_WS_LCD128_INCLUDE_BOARD_H
|
||||
#define __BOARDS_XTENSA_ESP32S3_ESP32S3_WS_LCD128_INCLUDE_BOARD_H
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Clocking *****************************************************************/
|
||||
|
||||
/* The ESP32-S3 DevKit board is fitted with a 40MHz crystal */
|
||||
|
||||
#define BOARD_XTAL_FREQUENCY 40000000
|
||||
|
||||
#ifdef CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ
|
||||
# define BOARD_CLOCK_FREQUENCY (CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ * 1000000)
|
||||
#else
|
||||
# define BOARD_CLOCK_FREQUENCY 80000000
|
||||
#endif
|
||||
|
||||
/* LED definitions **********************************************************/
|
||||
|
||||
/* Define how many LEDs this board has (needed by userleds) */
|
||||
|
||||
#define BOARD_NLEDS 0
|
||||
|
||||
/* GPIO pins used by the GPIO Subsystem */
|
||||
|
||||
#define BOARD_NGPIOOUT 0 /* Amount of GPIO Output pins */
|
||||
#define BOARD_NGPIOIN 0 /* Amount of GPIO Input without Interruption */
|
||||
#define BOARD_NGPIOINT 0 /* Amount of GPIO Input w/ Interruption pins */
|
||||
|
||||
/* IMU definitions **********************************************************/
|
||||
|
||||
#define QMI8658_I2C_PORT (0)
|
||||
#define QMI8658_I2C_ADDR (0x6B)
|
||||
|
||||
#endif /* __BOARDS_XTENSA_ESP32S3_ESP32S3_WS_LCD128_INCLUDE_BOARD_H */
|
||||
@@ -0,0 +1,118 @@
|
||||
/****************************************************************************
|
||||
* boards/xtensa/esp32s3/esp32s3-ws-lcd128/include/board_memorymap.h
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_XTENSA_ESP32S3_ESP32S3_WS_LCD128_INCLUDE_BOARD_MEMORYMAP_H
|
||||
#define __BOARDS_XTENSA_ESP32S3_ESP32S3_WS_LCD128_INCLUDE_BOARD_MEMORYMAP_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Kernel ROM */
|
||||
|
||||
#define KIROM_START (uintptr_t)__kirom_start
|
||||
#define KIROM_SIZE (uintptr_t)__kirom_size
|
||||
#define KDROM_START (uintptr_t)__kdrom_start
|
||||
#define KDROM_SIZE (uintptr_t)__kdrom_size
|
||||
|
||||
/* Kernel RAM */
|
||||
|
||||
#define KIRAM_START (uintptr_t)__kiram_start
|
||||
#define KIRAM_SIZE (uintptr_t)__kiram_size
|
||||
#define KIRAM_END (uintptr_t)__kiram_end
|
||||
#define KDRAM_START (uintptr_t)__kdram_start
|
||||
#define KDRAM_SIZE (uintptr_t)__kdram_size
|
||||
#define KDRAM_END (uintptr_t)__kdram_end
|
||||
|
||||
/* Exception vectors */
|
||||
|
||||
#define VECTORS_START (uintptr_t)__vectors_start
|
||||
#define VECTORS_END (uintptr_t)__vectors_end
|
||||
|
||||
/* User ROM */
|
||||
|
||||
#define UIROM_START (uintptr_t)__uirom_start
|
||||
#define UIROM_SIZE (uintptr_t)__uirom_size
|
||||
#define UIROM_END (uintptr_t)__uirom_end
|
||||
#define UDROM_START (uintptr_t)__udrom_start
|
||||
#define UDROM_SIZE (uintptr_t)__udrom_size
|
||||
#define UDROM_END (uintptr_t)__udrom_end
|
||||
|
||||
/* User RAM */
|
||||
|
||||
#define UIRAM_START (uintptr_t)__uiram_start
|
||||
#define UIRAM_SIZE (uintptr_t)__uiram_size
|
||||
#define UIRAM_END (uintptr_t)__uiram_end
|
||||
#define UDRAM_START (uintptr_t)__udram_start
|
||||
#define UDRAM_SIZE (uintptr_t)__udram_size
|
||||
#define UDRAM_END (uintptr_t)__udram_end
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* Kernel ROM (RX) */
|
||||
|
||||
extern uint8_t __kirom_start[];
|
||||
extern uint8_t __kirom_size[];
|
||||
extern uint8_t __kdrom_start[];
|
||||
extern uint8_t __kdrom_size[];
|
||||
|
||||
/* Kernel RAM (RW) */
|
||||
|
||||
extern uint8_t __kiram_start[];
|
||||
extern uint8_t __kiram_size[];
|
||||
extern uint8_t __kiram_end[];
|
||||
extern uint8_t __kdram_start[];
|
||||
extern uint8_t __kdram_size[];
|
||||
extern uint8_t __kdram_end[];
|
||||
|
||||
/* Exception vectors */
|
||||
|
||||
extern uint8_t __vectors_start[];
|
||||
extern uint8_t __vectors_end[];
|
||||
|
||||
/* User ROM (RX) */
|
||||
|
||||
extern uint8_t __uirom_start[];
|
||||
extern uint8_t __uirom_size[];
|
||||
extern uint8_t __uirom_end[];
|
||||
extern uint8_t __udrom_start[];
|
||||
extern uint8_t __udrom_size[];
|
||||
extern uint8_t __udrom_end[];
|
||||
|
||||
/* User RAM (RW) */
|
||||
|
||||
extern uint8_t __uiram_start[];
|
||||
extern uint8_t __uiram_size[];
|
||||
extern uint8_t __uiram_end[];
|
||||
extern uint8_t __udram_start[];
|
||||
extern uint8_t __udram_size[];
|
||||
extern uint8_t __udram_end[];
|
||||
|
||||
#endif /* __BOARDS_XTENSA_ESP32S3_ESP32S3_WS_LCD128_INCLUDE_BOARD_MEMORYMAP_H */
|
||||
@@ -0,0 +1,57 @@
|
||||
############################################################################
|
||||
# boards/xtensa/esp32s3/esp32s3-ws-lcd128/scripts/Make.defs
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership. The
|
||||
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance with the
|
||||
# License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
include $(TOPDIR)/.config
|
||||
include $(TOPDIR)/tools/Config.mk
|
||||
include $(TOPDIR)/tools/esp32s3/Config.mk
|
||||
include $(TOPDIR)/arch/xtensa/src/lx7/Toolchain.defs
|
||||
|
||||
ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_peripherals.ld
|
||||
ARCHSCRIPT += $(BOARD_COMMON_DIR)$(DELIM)scripts$(DELIM)esp32s3_rom_aliases.ld
|
||||
|
||||
# Pick the linker scripts from the board level if they exist, if not
|
||||
# pick the common linker scripts.
|
||||
|
||||
ifeq ($(CONFIG_BUILD_PROTECTED),y)
|
||||
ARCHSCRIPT += $(call FINDSCRIPT,protected_memory.ld)
|
||||
ARCHSCRIPT += $(call FINDSCRIPT,kernel-space.ld)
|
||||
else
|
||||
ARCHSCRIPT += $(call FINDSCRIPT,flat_memory.ld)
|
||||
ifneq ($(CONFIG_ESP32S3_APP_FORMAT_LEGACY),y)
|
||||
ARCHSCRIPT += $(call FINDSCRIPT,esp32s3_sections.ld)
|
||||
else
|
||||
ARCHSCRIPT += $(call FINDSCRIPT,legacy_sections.ld)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += -fno-strength-reduce
|
||||
endif
|
||||
|
||||
ARCHPICFLAGS = -fpic
|
||||
|
||||
CFLAGS := $(ARCHCFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
|
||||
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
|
||||
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
|
||||
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
|
||||
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
|
||||
AFLAGS := $(CFLAGS) -D__ASSEMBLY__
|
||||
@@ -0,0 +1,50 @@
|
||||
############################################################################
|
||||
# boards/xtensa/esp32s3/esp32s3-ws-lcd128/src/Make.defs
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
# contributor license agreements. See the NOTICE file distributed with
|
||||
# this work for additional information regarding copyright ownership. The
|
||||
# ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance with the
|
||||
# License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
############################################################################
|
||||
|
||||
CSRCS = esp32s3_boot.c esp32s3_bringup.c
|
||||
|
||||
ifeq ($(CONFIG_BOARDCTL),y)
|
||||
CSRCS += esp32s3_appinit.c
|
||||
ifeq ($(CONFIG_BOARDCTL_RESET),y)
|
||||
CSRCS += esp32s3_reset.c
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_ARCH_BUTTONS),y)
|
||||
CSRCS += esp32s3_buttons.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_DEV_GPIO),y)
|
||||
CSRCS += esp32s3_gpio.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_LCD_GC9A01),y)
|
||||
CSRCS += esp32s3_board_lcd_gc9a01.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SPI),y)
|
||||
CSRCS += esp32s3_board_spi.c
|
||||
endif
|
||||
|
||||
DEPPATH += --dep-path board
|
||||
VPATH += :board
|
||||
CFLAGS += ${INCDIR_PREFIX}$(TOPDIR)$(DELIM)arch$(DELIM)$(CONFIG_ARCH)$(DELIM)src$(DELIM)board$(DELIM)board
|
||||
@@ -0,0 +1,207 @@
|
||||
/****************************************************************************
|
||||
* boards/xtensa/esp32s3/esp32s3-ws-lcd128/src/esp32s3-ws-lcd128.h
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __BOARDS_XTENSA_ESP32S3_ESP32S3_WS_LCD128_SRC_ESP32S3_WS_LCD128_H
|
||||
#define __BOARDS_XTENSA_ESP32S3_ESP32S3_WS_LCD128_SRC_ESP32S3_WS_LCD128_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/compiler.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* RMT gpio */
|
||||
|
||||
#define RMT_RXCHANNEL (4)
|
||||
#define RMT_TXCHANNEL (0)
|
||||
|
||||
#ifdef CONFIG_RMT_LOOP_TEST_MODE
|
||||
# define RMT_INPUT_PIN (0)
|
||||
# define RMT_OUTPUT_PIN (0)
|
||||
#else
|
||||
# define RMT_INPUT_PIN (16)
|
||||
#endif
|
||||
|
||||
#define RMT_OUTPUT_PIN (15)
|
||||
|
||||
/* LCD gpio */
|
||||
|
||||
#if defined(CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_TOUCH) && \
|
||||
defined(CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_NOTOUCH)
|
||||
# error "CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_TOUCH is defined."
|
||||
# error "CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_NOTOUCH is defined."
|
||||
# error "These options are exclusive!"
|
||||
#elif !defined(CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_TOUCH) && \
|
||||
!defined(CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_NOTOUCH)
|
||||
# error "CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_TOUCH is not defined."
|
||||
# error "CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_NOTOUCH is not defined."
|
||||
# error "One of them must be defined!"
|
||||
#elif defined(CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_TOUCH)
|
||||
# ifdef CONFIG_LCD
|
||||
# define DISPLAY_SPI (2)
|
||||
# define DISPLAY_RST (14)
|
||||
# define DISPLAY_DC (8)
|
||||
# define DISPLAY_BCKL (2)
|
||||
# endif
|
||||
#elif defined(CONFIG_ARCH_BOARD_ESP32S3_WS_LCD128_NOTOUCH)
|
||||
# ifdef CONFIG_LCD
|
||||
# define DISPLAY_SPI (2)
|
||||
# define DISPLAY_RST (12)
|
||||
# define DISPLAY_DC (8)
|
||||
# define DISPLAY_BCKL (40)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_bringup
|
||||
*
|
||||
* Description:
|
||||
* Perform architecture-specific initialization
|
||||
*
|
||||
* CONFIG_BOARD_LATE_INITIALIZE=y :
|
||||
* Called from board_late_initialize().
|
||||
*
|
||||
* CONFIG_BOARD_LATE_INITIALIZE=y && CONFIG_BOARDCTL=y :
|
||||
* Called from the NSH library via board_app_initialize()
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int esp32s3_bringup(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_gpio_init
|
||||
*
|
||||
* Description:
|
||||
* Configure the GPIO driver.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; A negated errno value is returned
|
||||
* to indicate the nature of any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_DEV_GPIO
|
||||
int esp32s3_gpio_init(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_spiflash_init
|
||||
*
|
||||
* Description:
|
||||
* Initialize the SPIFLASH and register the MTD device.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ESP32S3_SPIFLASH
|
||||
int board_spiflash_init(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_i2c_init
|
||||
*
|
||||
* Description:
|
||||
* Configure the I2C driver.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; A negated errno value is returned
|
||||
* to indicate the nature of any failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_I2C_DRIVER
|
||||
int board_i2c_init(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_i2sdev_initialize
|
||||
*
|
||||
* Description:
|
||||
* This function is called by platform-specific, setup logic to configure
|
||||
* and register the generic I2S audio driver. This function will register
|
||||
* the driver as /dev/audio/pcm[x] where x is determined by the I2S port
|
||||
* number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* port - The I2S port used for the device
|
||||
* enable_tx - Register device as TX if true
|
||||
* enable_rx - Register device as RX if true
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
* returned to indicate the nature of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ESPRESSIF_I2S
|
||||
int board_i2sdev_initialize(int port, bool enable_tx, bool enable_rx);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ESP32S3_TWAI
|
||||
int esp32s3_twai_setup(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_lcd_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the onboard GC9A01 LCD device.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_LCD)
|
||||
int board_lcd_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_qmi8658_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the onboard QMI8658 IMU device uorb driver.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_SENSORS_QMI8658)
|
||||
int esp32s3_qmi8658_initialize(void);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __BOARDS_XTENSA_ESP32S3_ESP32S3_WS_LCD128_SRC_ESP32S3_WS_LCD128_H */
|
||||
@@ -0,0 +1,82 @@
|
||||
/****************************************************************************
|
||||
* boards/xtensa/esp32s3/esp32s3-ws-lcd128/src/esp32s3_appinit.c
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#include "esp32s3-ws-lcd128.h"
|
||||
|
||||
#ifdef CONFIG_BOARDCTL
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_app_initialize
|
||||
*
|
||||
* Description:
|
||||
* Perform application specific initialization. This function is never
|
||||
* called directly from application code, but only indirectly via the
|
||||
* (non-standard) boardctl() interface using the command BOARDIOC_INIT.
|
||||
*
|
||||
* Input Parameters:
|
||||
* arg - The boardctl() argument is passed to the board_app_initialize()
|
||||
* implementation without modification. The argument has no
|
||||
* meaning to NuttX; the meaning of the argument is a contract
|
||||
* between the board-specific initialization logic and the
|
||||
* matching application logic. The value could be such things as a
|
||||
* mode enumeration value, a set of DIP switch settings, a
|
||||
* pointer to configuration data read from a file or serial FLASH,
|
||||
* or whatever you would like to do with it. Every implementation
|
||||
* should accept zero/NULL as a default configuration.
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero (OK) is returned on success; a negated errno value is returned on
|
||||
* any failure to indicate the nature of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
#ifdef CONFIG_BOARD_LATE_INITIALIZE
|
||||
/* Board initialization already performed by board_late_initialize() */
|
||||
|
||||
return OK;
|
||||
#else
|
||||
/* Perform board-specific initialization */
|
||||
|
||||
return esp32s3_bringup();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BOARDCTL */
|
||||
@@ -0,0 +1,147 @@
|
||||
/****************************************************************************
|
||||
* boards/xtensa/esp32s3/esp32s3-ws-lcd128/src/esp32s3_board_lcd_gc9a01.c
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
#include <arch/board/board.h>
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <nuttx/lcd/lcd.h>
|
||||
#include <nuttx/lcd/gc9a01.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <syslog.h>
|
||||
|
||||
#include "espressif/esp_gpio.h"
|
||||
#include "esp32s3_spi.h"
|
||||
#include "esp32s3-ws-lcd128.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
static struct spi_dev_s *g_spidev;
|
||||
static struct lcd_dev_s *g_lcd = NULL;
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_lcd_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the LCD video hardware. The initial state of the LCD is
|
||||
* fully initialized, display memory cleared, and the LCD ready to use, but
|
||||
* with the power setting at 0 (full off).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_lcd_initialize(void)
|
||||
{
|
||||
syslog(LOG_DEBUG, "Initializing LCD GPIO pins.");
|
||||
|
||||
/* SPI RX is not used. Same pin is used as LCD Data/Command control */
|
||||
|
||||
esp_configgpio(DISPLAY_DC, OUTPUT);
|
||||
esp_gpiowrite(DISPLAY_DC, true);
|
||||
|
||||
/* Pull LCD_RESET high */
|
||||
|
||||
esp_configgpio(DISPLAY_RST, OUTPUT);
|
||||
esp_gpiowrite(DISPLAY_RST, false);
|
||||
up_mdelay(50);
|
||||
esp_gpiowrite(DISPLAY_RST, true);
|
||||
up_mdelay(50);
|
||||
|
||||
/* Set full brightness */
|
||||
|
||||
esp_configgpio(DISPLAY_BCKL, OUTPUT);
|
||||
esp_gpiowrite(DISPLAY_BCKL, true);
|
||||
|
||||
syslog(LOG_DEBUG, "Initializing LCD SPI %d port.\n", DISPLAY_SPI);
|
||||
|
||||
g_spidev = esp32s3_spibus_initialize(DISPLAY_SPI);
|
||||
if (!g_spidev)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to initialize LCD SPI port %d.\n",
|
||||
DISPLAY_SPI);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
syslog(LOG_DEBUG, "Initializing GC9A01 LCD.\n");
|
||||
|
||||
g_lcd = gc9a01_lcdinitialize(g_spidev);
|
||||
if (!g_lcd)
|
||||
{
|
||||
syslog(LOG_ERR, "Failed to initialize LCD %d.\n", 0);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_lcd_getdev
|
||||
*
|
||||
* Description:
|
||||
* Return a reference to the LCD object for the specified LCD. This
|
||||
* allows support for multiple LCD devices.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
struct lcd_dev_s *board_lcd_getdev(int devno)
|
||||
{
|
||||
if (!g_lcd)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: Failed to bind SPI port %d to LCD %d\n",
|
||||
DISPLAY_SPI, devno);
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
syslog(LOG_INFO, "SPI port %d bound to LCD %d.\n", DISPLAY_SPI, devno);
|
||||
return g_lcd;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_lcd_uninitialize
|
||||
*
|
||||
* Description:
|
||||
* Uninitialize the LCD support
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_lcd_uninitialize(void)
|
||||
{
|
||||
/* Turn the display off */
|
||||
|
||||
g_lcd->setpower(g_lcd, 0);
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
/****************************************************************************
|
||||
* boards/xtensa/esp32s3/esp32s3-ws-lcd128/src/esp32s3_board_spi.c
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/spi/spi.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "espressif/esp_gpio.h"
|
||||
#include "esp32s3-ws-lcd128.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_status
|
||||
****************************************************************************/
|
||||
|
||||
static inline uint8_t spi_status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
uint8_t status = 0;
|
||||
|
||||
#ifdef CONFIG_MMCSD_SPI
|
||||
if (devid == SPIDEV_MMCSD(0))
|
||||
{
|
||||
status |= SPI_STATUS_PRESENT;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_LCD_ILI9341) || defined(CONFIG_LCD_SSD1680) || defined(CONFIG_LCD_ST7789) || defined(CONFIG_LCD_GC9A01)
|
||||
if (devid == SPIDEV_DISPLAY(0))
|
||||
{
|
||||
status |= SPI_STATUS_PRESENT;
|
||||
}
|
||||
#endif
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: spi_cmddata
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SPI_CMDDATA
|
||||
|
||||
static inline int spi_cmddata(struct spi_dev_s *dev, uint32_t devid,
|
||||
bool cmd)
|
||||
{
|
||||
#if defined(CONFIG_LCD_ILI9341) || defined(CONFIG_LCD_SSD1680) || defined(CONFIG_LCD_ST7789) || defined(CONFIG_LCD_GC9A01)
|
||||
if (devid == SPIDEV_DISPLAY(0))
|
||||
{
|
||||
/* This is the Data/Command control pad which determines whether the
|
||||
* data bits are data or a command.
|
||||
*/
|
||||
|
||||
esp_gpiowrite(DISPLAY_DC, !cmd);
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ESP32S3_SPI2) && defined(CONFIG_ESP32S3_SPI_UDCS)
|
||||
void esp32s3_spi2_select(struct spi_dev_s *dev, uint32_t devid, bool select)
|
||||
{
|
||||
esp_gpiowrite(CONFIG_ESP32S3_SPI2_CSPIN, !select);
|
||||
}
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_spi2_status
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ESP32S3_SPI2
|
||||
|
||||
uint8_t esp32s3_spi2_status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
return spi_status(dev, devid);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_spi2_cmddata
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ESP32S3_SPI2) && defined(CONFIG_SPI_CMDDATA)
|
||||
|
||||
int esp32s3_spi2_cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
spiinfo("devid: %" PRIu32 " CMD: %s\n", devid, cmd ? "command" :
|
||||
"data");
|
||||
|
||||
return spi_cmddata(dev, devid, cmd);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_spi3_status
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ESP32S3_SPI3
|
||||
|
||||
uint8_t esp32s3_spi3_status(struct spi_dev_s *dev, uint32_t devid)
|
||||
{
|
||||
return spi_status(dev, devid);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_spi3_cmddata
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ESP32S3_SPI3) && defined(CONFIG_SPI_CMDDATA)
|
||||
|
||||
int esp32s3_spi3_cmddata(struct spi_dev_s *dev, uint32_t devid, bool cmd)
|
||||
{
|
||||
spiinfo("devid: %" PRIu32 " CMD: %s\n", devid, cmd ? "command" :
|
||||
"data");
|
||||
|
||||
return spi_cmddata(dev, devid, cmd);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,85 @@
|
||||
/****************************************************************************
|
||||
* boards/xtensa/esp32s3/esp32s3-ws-lcd128/src/esp32s3_boot.c
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/mm/mm.h>
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "esp32s3-ws-lcd128.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: esp32s3_board_initialize
|
||||
*
|
||||
* Description:
|
||||
* All ESP32-S3 boards must provide the following entry point.
|
||||
* This entry point is called early in the initialization -- after all
|
||||
* memory has been configured and mapped but before any devices have been
|
||||
* initialized.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void esp32s3_board_initialize(void)
|
||||
{
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_late_initialize
|
||||
*
|
||||
* Description:
|
||||
* If CONFIG_BOARD_LATE_INITIALIZE is selected, then an additional
|
||||
* initialization call will be performed in the boot-up sequence to a
|
||||
* function called board_late_initialize(). board_late_initialize() will
|
||||
* be called immediately after up_initialize() is called and just before
|
||||
* the initial application is started. This additional initialization
|
||||
* phase may be used, for example, to initialize board-specific device
|
||||
* drivers.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BOARD_LATE_INITIALIZE
|
||||
void board_late_initialize(void)
|
||||
{
|
||||
/* Perform board-specific initialization */
|
||||
|
||||
esp32s3_bringup();
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,166 @@
|
||||
/****************************************************************************
|
||||
* boards/xtensa/esp32s3/esp32s3-ws-lcd128/src/esp32s3_buttons.c
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <debug.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
#include "esp32s3_gpio.h"
|
||||
#include "hardware/esp32s3_gpio_sigmap.h"
|
||||
|
||||
#include "esp32s3-ws-lcd128.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_button_initialize
|
||||
*
|
||||
* Description:
|
||||
* board_button_initialize() must be called to initialize button resources.
|
||||
* After that, board_buttons() may be called to collect the current state
|
||||
* of all buttons or board_button_irq() may be called to register button
|
||||
* interrupt handlers.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint32_t board_button_initialize(void)
|
||||
{
|
||||
esp32s3_configgpio(BUTTON_BOOT, INPUT_FUNCTION_2 | PULLUP);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_buttons
|
||||
*
|
||||
* Description:
|
||||
* After board_button_initialize() has been called, board_buttons() may be
|
||||
* called to collect the state of all buttons. board_buttons() returns an
|
||||
* 8-bit bit set with each bit associated with a button. See the
|
||||
* BUTTON_*_BIT definitions in board.h for the meaning of each bit.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
uint32_t board_buttons(void)
|
||||
{
|
||||
uint8_t ret = 0;
|
||||
int i = 0;
|
||||
int n = 0;
|
||||
|
||||
bool b0 = esp32s3_gpioread(BUTTON_BOOT);
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
{
|
||||
up_mdelay(1);
|
||||
|
||||
bool b1 = esp32s3_gpioread(BUTTON_BOOT);
|
||||
|
||||
if (b0 == b1)
|
||||
{
|
||||
n++;
|
||||
}
|
||||
else
|
||||
{
|
||||
n = 0;
|
||||
}
|
||||
|
||||
if (3 == n)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
b0 = b1;
|
||||
}
|
||||
|
||||
iinfo("b=%d n=%d\n", b0, n);
|
||||
|
||||
/* Low value means that the button is pressed */
|
||||
|
||||
if (!b0)
|
||||
{
|
||||
ret = 0x1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_button_irq
|
||||
*
|
||||
* Description:
|
||||
* board_button_irq() may be called to register an interrupt handler that
|
||||
* will be called when a button is depressed or released. The ID value is
|
||||
* a button enumeration value that uniquely identifies a button resource.
|
||||
* See the BUTTON_* definitions in board.h for the meaning of enumeration
|
||||
* value.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_IRQBUTTONS
|
||||
int board_button_irq(int id, xcpt_t irqhandler, void *arg)
|
||||
{
|
||||
int ret;
|
||||
DEBUGASSERT(id == 0);
|
||||
|
||||
int irq = ESP32S3_PIN2IRQ(BUTTON_BOOT);
|
||||
|
||||
if (irqhandler != NULL)
|
||||
{
|
||||
/* Make sure the interrupt is disabled */
|
||||
|
||||
esp32s3_gpioirqdisable(irq);
|
||||
|
||||
ret = irq_attach(irq, irqhandler, arg);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: irq_attach() failed: %d\n", ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
gpioinfo("Attach %p\n", irqhandler);
|
||||
|
||||
gpioinfo("Enabling the interrupt\n");
|
||||
|
||||
/* Configure the interrupt for rising and falling edges */
|
||||
|
||||
esp32s3_gpioirqenable(irq, CHANGE);
|
||||
}
|
||||
else
|
||||
{
|
||||
gpioinfo("Disable the interrupt\n");
|
||||
esp32s3_gpioirqdisable(irq);
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,87 @@
|
||||
/****************************************************************************
|
||||
* boards/xtensa/esp32s3/esp32s3-ws-lcd128/src/esp32s3_reset.c
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership. The
|
||||
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <debug.h>
|
||||
#include <assert.h>
|
||||
#include <nuttx/arch.h>
|
||||
#include <nuttx/board.h>
|
||||
|
||||
#include "esp32s3_systemreset.h"
|
||||
|
||||
#ifdef CONFIG_BOARDCTL_RESET
|
||||
|
||||
#if CONFIG_BOARD_ASSERT_RESET_VALUE == EXIT_SUCCESS
|
||||
# error "CONFIG_BOARD_ASSERT_RESET_VALUE must not be equal to EXIT_SUCCESS"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_reset
|
||||
*
|
||||
* Description:
|
||||
* Reset board. Support for this function is required by board-level
|
||||
* logic if CONFIG_BOARDCTL_RESET is selected.
|
||||
*
|
||||
* Input Parameters:
|
||||
* status - Status information provided with the reset event. This
|
||||
* meaning of this status information is board-specific. If not
|
||||
* used by a board, the value zero may be provided in calls to
|
||||
* board_reset().
|
||||
*
|
||||
* Returned Value:
|
||||
* If this function returns, then it was not possible to power-off the
|
||||
* board due to some constraints. The return value in this case is a
|
||||
* board-specific reason for the failure to shutdown.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_reset(int status)
|
||||
{
|
||||
syslog(LOG_INFO, "reboot status=%d\n", status);
|
||||
|
||||
switch (status)
|
||||
{
|
||||
case EXIT_SUCCESS:
|
||||
up_shutdown_handler();
|
||||
break;
|
||||
case CONFIG_BOARD_ASSERT_RESET_VALUE:
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
up_systemreset();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BOARDCTL_RESET */
|
||||