Merge branch 'master' into release/v3.0.x
This commit is contained in:
commit
f450243b27
53 changed files with 6374 additions and 309 deletions
8
.github/scripts/install-platformio-esp32.sh
vendored
8
.github/scripts/install-platformio-esp32.sh
vendored
|
|
@ -6,7 +6,7 @@ PLATFORMIO_ESP32_URL="https://github.com/platformio/platform-espressif32.git"
|
|||
TOOLCHAIN_VERSION="12.2.0+20230208"
|
||||
ESPTOOLPY_VERSION="~1.40501.0"
|
||||
ESPRESSIF_ORGANIZATION_NAME="espressif"
|
||||
LIBS_DIR="tools/esp32-arduino-libs"
|
||||
SDKCONFIG_DIR="$PLATFORMIO_ESP32_PATH/tools/esp32-arduino-libs"
|
||||
|
||||
echo "Installing Python Wheel ..."
|
||||
pip install wheel > /dev/null 2>&1
|
||||
|
|
@ -100,7 +100,8 @@ function count_sketches(){ # count_sketches <examples-path>
|
|||
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
|
||||
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
|
||||
for requirement in $requirements; do
|
||||
found_line=$(grep -E "^$requirement" $LIBS_DIR/esp32/sdkconfig)
|
||||
requirement=$(echo $requirement | xargs)
|
||||
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
|
||||
if [[ "$found_line" == "" ]]; then
|
||||
continue 2
|
||||
fi
|
||||
|
|
@ -190,7 +191,8 @@ function build_pio_sketches(){ # build_pio_sketches <board> <options> <examples-
|
|||
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
|
||||
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
|
||||
for requirement in $requirements; do
|
||||
found_line=$(grep -E "^$requirement" $LIBS_DIR/esp32/sdkconfig)
|
||||
requirement=$(echo $requirement | xargs)
|
||||
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/esp32/sdkconfig")
|
||||
if [[ "$found_line" == "" ]]; then
|
||||
continue 2
|
||||
fi
|
||||
|
|
|
|||
60
.github/scripts/sketch_utils.sh
vendored
60
.github/scripts/sketch_utils.sh
vendored
|
|
@ -1,6 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
LIBS_DIR="tools/esp32-arduino-libs"
|
||||
if [ -d "$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs" ]; then
|
||||
SDKCONFIG_DIR="$ARDUINO_ESP32_PATH/tools/esp32-arduino-libs"
|
||||
elif [ -d "$GITHUB_WORKSPACE/tools/esp32-arduino-libs" ]; then
|
||||
SDKCONFIG_DIR="$GITHUB_WORKSPACE/tools/esp32-arduino-libs"
|
||||
else
|
||||
SDKCONFIG_DIR="tools/esp32-arduino-libs"
|
||||
fi
|
||||
|
||||
function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [extra-options]
|
||||
while [ ! -z "$1" ]; do
|
||||
|
|
@ -83,14 +89,21 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
|
|||
|
||||
len=1
|
||||
|
||||
if [ -f $sketchdir/ci.json ]; then
|
||||
fqbn_append=`jq -r '.fqbn_append' $sketchdir/ci.json`
|
||||
if [ $fqbn_append == "null" ]; then
|
||||
fqbn_append=""
|
||||
fi
|
||||
fi
|
||||
|
||||
# Default FQBN options if none were passed in the command line.
|
||||
|
||||
esp32_opts="PSRAM=enabled,PartitionScheme=huge_app,FlashMode=dio"
|
||||
esp32s2_opts="PSRAM=enabled,PartitionScheme=huge_app,FlashMode=dio"
|
||||
esp32s3_opts="PSRAM=opi,USBMode=default,PartitionScheme=huge_app,FlashMode=dio"
|
||||
esp32c3_opts="PartitionScheme=huge_app,FlashMode=dio"
|
||||
esp32c6_opts="PartitionScheme=huge_app,FlashMode=dio"
|
||||
esp32h2_opts="PartitionScheme=huge_app,FlashMode=dio"
|
||||
esp32_opts="PSRAM=enabled,FlashMode=dio${fqbn_append:+,$fqbn_append}"
|
||||
esp32s2_opts="PSRAM=enabled,FlashMode=dio${fqbn_append:+,$fqbn_append}"
|
||||
esp32s3_opts="PSRAM=opi,USBMode=default,FlashMode=dio${fqbn_append:+,$fqbn_append}"
|
||||
esp32c3_opts="FlashMode=dio${fqbn_append:+,$fqbn_append}"
|
||||
esp32c6_opts="FlashMode=dio${fqbn_append:+,$fqbn_append}"
|
||||
esp32h2_opts="FlashMode=dio${fqbn_append:+,$fqbn_append}"
|
||||
|
||||
# Select the common part of the FQBN based on the target. The rest will be
|
||||
# appended depending on the passed options.
|
||||
|
|
@ -154,7 +167,8 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
|
|||
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
|
||||
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
|
||||
for requirement in $requirements; do
|
||||
found_line=$(grep -E "^$requirement" $LIBS_DIR/$target/sdkconfig)
|
||||
requirement=$(echo $requirement | xargs)
|
||||
found_line=$(grep -E "^$requirement" "$SDKCONFIG_DIR/$target/sdkconfig")
|
||||
if [[ "$found_line" == "" ]]; then
|
||||
echo "Target $target does not meet the requirement $requirement for $sketchname. Skipping."
|
||||
exit 0
|
||||
|
|
@ -270,10 +284,11 @@ function build_sketch(){ # build_sketch <ide_path> <user_path> <path-to-ino> [ex
|
|||
unset options
|
||||
}
|
||||
|
||||
function count_sketches(){ # count_sketches <path> [target] [file]
|
||||
function count_sketches(){ # count_sketches <path> [target] [file] [ignore-requirements]
|
||||
local path=$1
|
||||
local target=$2
|
||||
local file=$3
|
||||
local ignore_requirements=$3
|
||||
local file=$4
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo "ERROR: Illegal number of parameters"
|
||||
|
|
@ -286,7 +301,7 @@ function count_sketches(){ # count_sketches <path> [target] [file]
|
|||
return 0
|
||||
fi
|
||||
|
||||
if [ -n "$file" ]; then
|
||||
if [ -f "$file" ]; then
|
||||
local sketches=$(cat $file)
|
||||
else
|
||||
local sketches=$(find $path -name *.ino | sort)
|
||||
|
|
@ -306,15 +321,18 @@ function count_sketches(){ # count_sketches <path> [target] [file]
|
|||
continue
|
||||
fi
|
||||
|
||||
# Check if the sketch requires any configuration options
|
||||
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
|
||||
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
|
||||
for requirement in $requirements; do
|
||||
found_line=$(grep -E "^$requirement" $LIBS_DIR/$target/sdkconfig)
|
||||
if [[ "$found_line" == "" ]]; then
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
if [ "$ignore_requirements" != "1" ]; then
|
||||
# Check if the sketch requires any configuration options
|
||||
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
|
||||
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
|
||||
for requirement in $requirements; do
|
||||
requirement=$(echo $requirement | xargs)
|
||||
found_line=$(grep -E "^$requirement" $SDKCONFIG_DIR/$target/sdkconfig)
|
||||
if [[ "$found_line" == "" ]]; then
|
||||
continue 2
|
||||
fi
|
||||
done
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo $sketch >> sketches.txt
|
||||
|
|
@ -392,7 +410,7 @@ function build_sketches(){ # build_sketches <ide_path> <user_path> <target> <pat
|
|||
|
||||
set +e
|
||||
if [ -n "$sketches_file" ]; then
|
||||
count_sketches "$path" "$target" "$sketches_file"
|
||||
count_sketches "$path" "$target" "0" "$sketches_file"
|
||||
local sketchcount=$?
|
||||
else
|
||||
count_sketches "$path" "$target"
|
||||
|
|
|
|||
31
.github/scripts/tests_run.sh
vendored
31
.github/scripts/tests_run.sh
vendored
|
|
@ -10,6 +10,21 @@ function run_test() {
|
|||
local result=0
|
||||
local error=0
|
||||
|
||||
if [ $options -eq 0 ] && [ -f $sketchdir/ci.json ]; then
|
||||
len=`jq -r --arg target $target '.fqbn[$target] | length' $sketchdir/ci.json`
|
||||
if [ $len -eq 0 ]; then
|
||||
len=1
|
||||
fi
|
||||
else
|
||||
len=1
|
||||
fi
|
||||
|
||||
if [ $len -eq 1 ]; then
|
||||
SDKCONFIG_PATH="$HOME/.arduino/tests/$sketchname/build.tmp/sdkconfig"
|
||||
else
|
||||
SDKCONFIG_PATH="$HOME/.arduino/tests/$sketchname/build0.tmp/sdkconfig"
|
||||
fi
|
||||
|
||||
if [ -f $sketchdir/ci.json ]; then
|
||||
# If the target or platform is listed as false, skip the sketch. Otherwise, include it.
|
||||
is_target=$(jq -r --arg target $target '.targets[$target]' $sketchdir/ci.json)
|
||||
|
|
@ -25,7 +40,8 @@ function run_test() {
|
|||
requirements=$(jq -r '.requires[]? // empty' $sketchdir/ci.json)
|
||||
if [[ "$requirements" != "null" ]] || [[ "$requirements" != "" ]]; then
|
||||
for requirement in $requirements; do
|
||||
found_line=$(grep -E "^$requirement" $LIBS_DIR/$target/sdkconfig)
|
||||
requirement=$(echo $requirement | xargs)
|
||||
found_line=$(grep -E "^$requirement" "$SDKCONFIG_PATH")
|
||||
if [[ "$found_line" == "" ]]; then
|
||||
printf "\033[93mTarget $target does not meet the requirement $requirement for $sketchname. Skipping.\033[0m\n"
|
||||
printf "\n\n\n"
|
||||
|
|
@ -35,15 +51,6 @@ function run_test() {
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ $options -eq 0 ] && [ -f $sketchdir/ci.json ]; then
|
||||
len=`jq -r --arg target $target '.fqbn[$target] | length' $sketchdir/ci.json`
|
||||
if [ $len -eq 0 ]; then
|
||||
len=1
|
||||
fi
|
||||
else
|
||||
len=1
|
||||
fi
|
||||
|
||||
if [ $len -eq 1 ]; then
|
||||
# build_dir="$sketchdir/build"
|
||||
build_dir="$HOME/.arduino/tests/$sketchname/build.tmp"
|
||||
|
|
@ -120,7 +127,6 @@ function run_test() {
|
|||
|
||||
SCRIPTS_DIR="./.github/scripts"
|
||||
COUNT_SKETCHES="${SCRIPTS_DIR}/sketch_utils.sh count"
|
||||
LIBS_DIR="tools/esp32-arduino-libs"
|
||||
|
||||
platform="hardware"
|
||||
wokwi_timeout=60000
|
||||
|
|
@ -223,7 +229,8 @@ else
|
|||
fi
|
||||
|
||||
set +e
|
||||
${COUNT_SKETCHES} $test_folder $target
|
||||
# Ignore requirements as we don't have the libs. The requirements will be checked in the run_test function
|
||||
${COUNT_SKETCHES} "$test_folder" "$target" "1"
|
||||
sketchcount=$?
|
||||
set -e
|
||||
sketches=$(cat sketches.txt)
|
||||
|
|
|
|||
3
.github/workflows/tests_build.yml
vendored
3
.github/workflows/tests_build.yml
vendored
|
|
@ -29,6 +29,7 @@ jobs:
|
|||
~/.arduino/tests/**/build*.tmp/*.bin
|
||||
~/.arduino/tests/**/build*.tmp/*.elf
|
||||
~/.arduino/tests/**/build*.tmp/*.json
|
||||
~/.arduino/tests/**/build*.tmp/sdkconfig
|
||||
|
||||
- name: Evaluate if tests should be built
|
||||
id: check-build
|
||||
|
|
@ -75,6 +76,7 @@ jobs:
|
|||
~/.arduino/tests/**/build*.tmp/*.bin
|
||||
~/.arduino/tests/**/build*.tmp/*.elf
|
||||
~/.arduino/tests/**/build*.tmp/*.json
|
||||
~/.arduino/tests/**/build*.tmp/sdkconfig
|
||||
|
||||
- name: Upload ${{ inputs.chip }} ${{ inputs.type }} binaries as artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
|
|
@ -85,3 +87,4 @@ jobs:
|
|||
~/.arduino/tests/**/build*.tmp/*.bin
|
||||
~/.arduino/tests/**/build*.tmp/*.elf
|
||||
~/.arduino/tests/**/build*.tmp/*.json
|
||||
~/.arduino/tests/**/build*.tmp/sdkconfig
|
||||
|
|
|
|||
4
.github/workflows/tests_hw.yml
vendored
4
.github/workflows/tests_hw.yml
vendored
|
|
@ -59,10 +59,6 @@ jobs:
|
|||
sparse-checkout: |
|
||||
*
|
||||
|
||||
- name: List files
|
||||
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
|
||||
run: ls -la
|
||||
|
||||
# setup-python currently only works on ubuntu images
|
||||
# - uses: actions/setup-python@v5
|
||||
# if: ${{ steps.check-tests.outputs.enabled == 'true' }}
|
||||
|
|
|
|||
2766
boards.txt
2766
boards.txt
File diff suppressed because it is too large
Load diff
|
|
@ -24,16 +24,13 @@
|
|||
#endif
|
||||
|
||||
void serialEvent(void) __attribute__((weak));
|
||||
void serialEvent(void) {}
|
||||
|
||||
#if SOC_UART_NUM > 1
|
||||
void serialEvent1(void) __attribute__((weak));
|
||||
void serialEvent1(void) {}
|
||||
#endif /* SOC_UART_NUM > 1 */
|
||||
|
||||
#if SOC_UART_NUM > 2
|
||||
void serialEvent2(void) __attribute__((weak));
|
||||
void serialEvent2(void) {}
|
||||
#endif /* SOC_UART_NUM > 2 */
|
||||
|
||||
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
|
||||
|
|
@ -48,37 +45,35 @@ HardwareSerial Serial2(2);
|
|||
|
||||
#if HWCDC_SERIAL_IS_DEFINED == 1 // Hardware JTAG CDC Event
|
||||
extern void HWCDCSerialEvent(void) __attribute__((weak));
|
||||
void HWCDCSerialEvent(void) {}
|
||||
#endif
|
||||
|
||||
#if USB_SERIAL_IS_DEFINED == 1 // Native USB CDC Event
|
||||
// Used by Hardware Serial for USB CDC events
|
||||
extern void USBSerialEvent(void) __attribute__((weak));
|
||||
void USBSerialEvent(void) {}
|
||||
#endif
|
||||
|
||||
void serialEventRun(void) {
|
||||
#if HWCDC_SERIAL_IS_DEFINED == 1 // Hardware JTAG CDC Event
|
||||
if (HWCDCSerial.available()) {
|
||||
if (HWCDCSerialEvent && HWCDCSerial.available()) {
|
||||
HWCDCSerialEvent();
|
||||
}
|
||||
#endif
|
||||
#if USB_SERIAL_IS_DEFINED == 1 // Native USB CDC Event
|
||||
if (USBSerial.available()) {
|
||||
if (USBSerialEvent && USBSerial.available()) {
|
||||
USBSerialEvent();
|
||||
}
|
||||
#endif
|
||||
// UART0 is default serialEvent()
|
||||
if (Serial0.available()) {
|
||||
if (serialEvent && Serial0.available()) {
|
||||
serialEvent();
|
||||
}
|
||||
#if SOC_UART_NUM > 1
|
||||
if (Serial1.available()) {
|
||||
if (serialEvent1 && Serial1.available()) {
|
||||
serialEvent1();
|
||||
}
|
||||
#endif
|
||||
#if SOC_UART_NUM > 2
|
||||
if (Serial2.available()) {
|
||||
if (serialEvent2 && Serial2.available()) {
|
||||
serialEvent2();
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -166,8 +166,47 @@ And in the ``README.md`` file:
|
|||
|
||||
Currently, this example requires Wi-Fi and supports the following targets.
|
||||
|
||||
| Supported Targets | ESP32 | ESP32-H2 | ESP32-S3 | ESP32-C3 | ESP32-C6 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- | -------- |
|
||||
| Supported Targets | ESP32 | ESP32-S3 | ESP32-C3 | ESP32-C6 |
|
||||
| ----------------- | ----- | -------- | -------- | -------- |
|
||||
|
||||
By default, the CI system will use the FQBNs specified in the ``.github/scripts/sketch_utils.sh`` file to compile the sketches.
|
||||
Currently, the default FQBNs are:
|
||||
|
||||
* ``espressif:esp32:esp32:PSRAM=enabled,FlashMode=dio``
|
||||
* ``espressif:esp32:esp32s2:PSRAM=enabled,FlashMode=dio``
|
||||
* ``espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,FlashMode=dio``
|
||||
* ``espressif:esp32:esp32c3:FlashMode=dio``
|
||||
* ``espressif:esp32:esp32c6:FlashMode=dio``
|
||||
* ``espressif:esp32:esp32h2:FlashMode=dio``
|
||||
|
||||
There are two ways to alter the FQBNs used to compile the sketches: by using the ``fqbn`` or ``fqbn_append`` fields in the ``ci.json`` file.
|
||||
|
||||
If you just want to append a string to the default FQBNs, you can use the ``fqbn_append`` field. For example, to add the ``DebugLevel=debug`` to the FQBNs, you would use:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"fqbn_append": "DebugLevel=debug"
|
||||
}
|
||||
|
||||
If you want to override the default FQBNs, you can use the ``fqbn`` field. It is a dictionary where the key is the target name and the value is a list of FQBNs.
|
||||
The FQBNs in the list will be used in sequence to compile the sketch. For example, to compile a sketch for ESP32-S2 with and without PSRAM enabled, you would use:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"fqbn": {
|
||||
"esp32s2": [
|
||||
"espressif:esp32:esp32s2:PSRAM=enabled,FlashMode=dio",
|
||||
"espressif:esp32:esp32s2:PSRAM=disabled,FlashMode=dio"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
.. note::
|
||||
|
||||
The FQBNs specified in the ``fqbn`` field will also override the options specified in the ``fqbn_append`` field.
|
||||
That means that if the ``fqbn`` field is specified, the ``fqbn_append`` field will be ignored and will have no effect.
|
||||
|
||||
Example Template
|
||||
****************
|
||||
|
|
@ -376,9 +415,10 @@ The ``ci.json`` file is used to specify how the test suite and sketches will han
|
|||
* ``platforms``: A dictionary that specifies the supported platforms. The key is the platform name and the value is a boolean that specifies if
|
||||
the platform is supported. By default, all platforms are assumed to be supported.
|
||||
* ``extra_tags``: A list of extra tags that the runner will require when running the test suite in hardware. By default, no extra tags are required.
|
||||
* ``fqbn_append``: A string to be appended to the default FQBNs. By default, no string is appended. This has no effect if ``fqbn`` is specified.
|
||||
* ``fqbn``: A dictionary that specifies the FQBNs that will be used to compile the sketch. The key is the target name and the value is a list
|
||||
of FQBNs. The `default FQBNs <https://github.com/espressif/arduino-esp32/blob/a31a5fca1739993173caba995f7785b8eed6b30e/.github/scripts/sketch_utils.sh#L86-L91>`_
|
||||
are used if this field is not specified.
|
||||
are used if this field is not specified. This overrides the default FQBNs and the ``fqbn_append`` field.
|
||||
|
||||
The ``wifi`` test suite is a good example of how to use the ``ci.json`` file:
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,21 @@ extern "C" {
|
|||
|
||||
#include "lwip/priv/tcpip_priv.h"
|
||||
|
||||
#ifdef CONFIG_LWIP_TCPIP_CORE_LOCKING
|
||||
#define UDP_MUTEX_LOCK() \
|
||||
if (!sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) { \
|
||||
LOCK_TCPIP_CORE(); \
|
||||
}
|
||||
|
||||
#define UDP_MUTEX_UNLOCK() \
|
||||
if (sys_thread_tcpip(LWIP_CORE_LOCK_QUERY_HOLDER)) { \
|
||||
UNLOCK_TCPIP_CORE(); \
|
||||
}
|
||||
#else // CONFIG_LWIP_TCPIP_CORE_LOCKING
|
||||
#define UDP_MUTEX_LOCK()
|
||||
#define UDP_MUTEX_UNLOCK()
|
||||
#endif // CONFIG_LWIP_TCPIP_CORE_LOCKING
|
||||
|
||||
static const char *netif_ifkeys[TCPIP_ADAPTER_IF_MAX] = {"WIFI_STA_DEF", "WIFI_AP_DEF", "ETH_DEF", "PPP_DEF"};
|
||||
|
||||
static esp_err_t tcpip_adapter_get_netif(tcpip_adapter_if_t tcpip_if, void **netif) {
|
||||
|
|
@ -28,7 +43,9 @@ static esp_err_t tcpip_adapter_get_netif(tcpip_adapter_if_t tcpip_if, void **net
|
|||
if (netif_index < 0) {
|
||||
return ESP_FAIL;
|
||||
}
|
||||
UDP_MUTEX_LOCK();
|
||||
*netif = (void *)netif_get_by_index(netif_index);
|
||||
UDP_MUTEX_UNLOCK();
|
||||
} else {
|
||||
*netif = netif_default;
|
||||
}
|
||||
|
|
@ -232,9 +249,6 @@ static bool _udp_task_stop(){
|
|||
}
|
||||
*/
|
||||
|
||||
#define UDP_MUTEX_LOCK() //xSemaphoreTake(_lock, portMAX_DELAY)
|
||||
#define UDP_MUTEX_UNLOCK() //xSemaphoreGive(_lock)
|
||||
|
||||
AsyncUDPMessage::AsyncUDPMessage(size_t size) {
|
||||
_index = 0;
|
||||
if (size > CONFIG_TCP_MSS) {
|
||||
|
|
@ -473,12 +487,14 @@ bool AsyncUDP::_init() {
|
|||
if (_pcb) {
|
||||
return true;
|
||||
}
|
||||
UDP_MUTEX_LOCK();
|
||||
_pcb = udp_new();
|
||||
if (!_pcb) {
|
||||
UDP_MUTEX_UNLOCK();
|
||||
return false;
|
||||
}
|
||||
//_lock = xSemaphoreCreateMutex();
|
||||
udp_recv(_pcb, &_udp_recv, (void *)this);
|
||||
UDP_MUTEX_UNLOCK();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -493,14 +509,12 @@ AsyncUDP::~AsyncUDP() {
|
|||
close();
|
||||
UDP_MUTEX_LOCK();
|
||||
udp_recv(_pcb, NULL, NULL);
|
||||
UDP_MUTEX_UNLOCK();
|
||||
_udp_remove(_pcb);
|
||||
_pcb = NULL;
|
||||
UDP_MUTEX_UNLOCK();
|
||||
//vSemaphoreDelete(_lock);
|
||||
}
|
||||
|
||||
void AsyncUDP::close() {
|
||||
UDP_MUTEX_LOCK();
|
||||
if (_pcb != NULL) {
|
||||
if (_connected) {
|
||||
_udp_disconnect(_pcb);
|
||||
|
|
@ -508,7 +522,6 @@ void AsyncUDP::close() {
|
|||
_connected = false;
|
||||
//todo: unjoin multicast group
|
||||
}
|
||||
UDP_MUTEX_UNLOCK();
|
||||
}
|
||||
|
||||
bool AsyncUDP::connect(const ip_addr_t *addr, uint16_t port) {
|
||||
|
|
@ -520,14 +533,11 @@ bool AsyncUDP::connect(const ip_addr_t *addr, uint16_t port) {
|
|||
return false;
|
||||
}
|
||||
close();
|
||||
UDP_MUTEX_LOCK();
|
||||
_lastErr = _udp_connect(_pcb, addr, port);
|
||||
if (_lastErr != ERR_OK) {
|
||||
UDP_MUTEX_UNLOCK();
|
||||
return false;
|
||||
}
|
||||
_connected = true;
|
||||
UDP_MUTEX_UNLOCK();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -544,13 +554,10 @@ bool AsyncUDP::listen(const ip_addr_t *addr, uint16_t port) {
|
|||
IP_SET_TYPE_VAL(_pcb->local_ip, addr->type);
|
||||
IP_SET_TYPE_VAL(_pcb->remote_ip, addr->type);
|
||||
}
|
||||
UDP_MUTEX_LOCK();
|
||||
if (_udp_bind(_pcb, addr, port) != ERR_OK) {
|
||||
UDP_MUTEX_UNLOCK();
|
||||
return false;
|
||||
}
|
||||
_connected = true;
|
||||
UDP_MUTEX_UNLOCK();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -624,12 +631,10 @@ bool AsyncUDP::listenMulticast(const ip_addr_t *addr, uint16_t port, uint8_t ttl
|
|||
return false;
|
||||
}
|
||||
|
||||
UDP_MUTEX_LOCK();
|
||||
_pcb->mcast_ttl = ttl;
|
||||
_pcb->remote_port = port;
|
||||
ip_addr_copy(_pcb->remote_ip, *addr);
|
||||
//ip_addr_copy(_pcb->remote_ip, ip_addr_any_type);
|
||||
UDP_MUTEX_UNLOCK();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -651,7 +656,6 @@ size_t AsyncUDP::writeTo(const uint8_t *data, size_t len, const ip_addr_t *addr,
|
|||
if (pbt != NULL) {
|
||||
uint8_t *dst = reinterpret_cast<uint8_t *>(pbt->payload);
|
||||
memcpy(dst, data, len);
|
||||
UDP_MUTEX_LOCK();
|
||||
if (tcpip_if < TCPIP_ADAPTER_IF_MAX) {
|
||||
void *nif = NULL;
|
||||
tcpip_adapter_get_netif((tcpip_adapter_if_t)tcpip_if, &nif);
|
||||
|
|
@ -663,7 +667,6 @@ size_t AsyncUDP::writeTo(const uint8_t *data, size_t len, const ip_addr_t *addr,
|
|||
} else {
|
||||
_lastErr = _udp_sendto(_pcb, pbt, addr, port);
|
||||
}
|
||||
UDP_MUTEX_UNLOCK();
|
||||
pbuf_free(pbt);
|
||||
if (_lastErr < ERR_OK) {
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#define LEDC_FADE_TIME (3000)
|
||||
|
||||
bool fade_ended = false; // status of LED fade
|
||||
bool fade_on = true;
|
||||
bool fade_in = true;
|
||||
|
||||
void ARDUINO_ISR_ATTR LED_FADE_ISR() {
|
||||
fade_ended = true;
|
||||
|
|
@ -55,15 +55,15 @@ void loop() {
|
|||
Serial.println("LED fade ended");
|
||||
fade_ended = false;
|
||||
|
||||
// Check if last fade was fade on
|
||||
if (fade_on) {
|
||||
// Check what fade should be started next
|
||||
if (fade_in) {
|
||||
ledcFadeWithInterrupt(LED_PIN, LEDC_START_DUTY, LEDC_TARGET_DUTY, LEDC_FADE_TIME, LED_FADE_ISR);
|
||||
Serial.println("LED Fade off started.");
|
||||
fade_on = false;
|
||||
Serial.println("LED Fade in started.");
|
||||
fade_in = false;
|
||||
} else {
|
||||
ledcFadeWithInterrupt(LED_PIN, LEDC_TARGET_DUTY, LEDC_START_DUTY, LEDC_FADE_TIME, LED_FADE_ISR);
|
||||
Serial.println("LED Fade on started.");
|
||||
fade_on = true;
|
||||
Serial.println("LED Fade out started.");
|
||||
fade_in = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
{
|
||||
"fqbn": {
|
||||
"esp32": [
|
||||
"espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=custom,FlashMode=dio",
|
||||
"espressif:esp32:esp32:PSRAM=disabled,PartitionScheme=custom,FlashMode=dio"
|
||||
],
|
||||
"esp32s2": [
|
||||
"espressif:esp32:esp32s2:PSRAM=enabled,PartitionScheme=custom,FlashMode=dio",
|
||||
"espressif:esp32:esp32s2:PSRAM=disabled,PartitionScheme=custom,FlashMode=dio"
|
||||
],
|
||||
"esp32s3": [
|
||||
"espressif:esp32:esp32s3:PSRAM=opi,USBMode=default,PartitionScheme=custom,FlashMode=qio",
|
||||
"espressif:esp32:esp32s3:PSRAM=enabled,USBMode=default,PartitionScheme=custom,FlashMode=qio",
|
||||
"espressif:esp32:esp32s3:PSRAM=disabled,USBMode=default,PartitionScheme=custom,FlashMode=qio"
|
||||
]
|
||||
},
|
||||
"requires": [
|
||||
"CONFIG_CAMERA_TASK_STACK_SIZE=[0-9]+"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
# Name, Type, SubType, Offset, Size, Flags
|
||||
nvs, data, nvs, 0x9000, 0x5000,
|
||||
otadata, data, ota, 0xe000, 0x2000,
|
||||
app0, app, ota_0, 0x10000, 0x3d0000,
|
||||
fr, data, , 0x3e0000, 0x20000,
|
||||
app0, app, ota_0, 0x10000, 0x3c0000,
|
||||
fr, data, , 0x3d0000, 0x20000,
|
||||
coredump, data, coredump,0x3f0000, 0x10000,
|
||||
|
|
|
|||
|
|
|
@ -19,7 +19,7 @@ Below are the details of the class:
|
|||
```cpp
|
||||
class OpenThreadCLI : public Stream {
|
||||
private:
|
||||
static size_t setBuffer(xQueueHandle &queue, size_t len);
|
||||
static size_t setBuffer(QueueHandle_t &queue, size_t len);
|
||||
bool otStarted = false;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@
|
|||
|
||||
static TaskHandle_t s_cli_task = NULL;
|
||||
static TaskHandle_t s_console_cli_task = NULL;
|
||||
static xQueueHandle rx_queue = NULL;
|
||||
static xQueueHandle tx_queue = NULL;
|
||||
static QueueHandle_t rx_queue = NULL;
|
||||
static QueueHandle_t tx_queue = NULL;
|
||||
|
||||
static esp_openthread_platform_config_t ot_native_config;
|
||||
static TaskHandle_t s_ot_task = NULL;
|
||||
|
|
@ -389,7 +389,7 @@ size_t OpenThreadCLI::write(uint8_t c) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
size_t OpenThreadCLI::setBuffer(xQueueHandle &queue, size_t queue_len) {
|
||||
size_t OpenThreadCLI::setBuffer(QueueHandle_t &queue, size_t queue_len) {
|
||||
if (queue) {
|
||||
vQueueDelete(queue);
|
||||
queue = NULL;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ typedef std::function<void(void)> OnReceiveCb_t;
|
|||
|
||||
class OpenThreadCLI : public Stream {
|
||||
private:
|
||||
static size_t setBuffer(xQueueHandle &queue, size_t len);
|
||||
static size_t setBuffer(QueueHandle_t &queue, size_t len);
|
||||
bool otStarted = false;
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"fqbn_append": "PartitionScheme=rainmaker_4MB",
|
||||
"requires": [
|
||||
"CONFIG_SOC_WIFI_SUPPORTED=y",
|
||||
"CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK"
|
||||
"CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK=[1-9][0-9]*"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"fqbn_append": "PartitionScheme=rainmaker_4MB",
|
||||
"requires": [
|
||||
"CONFIG_SOC_WIFI_SUPPORTED=y",
|
||||
"CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK"
|
||||
"CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK=[1-9][0-9]*"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"fqbn_append": "PartitionScheme=rainmaker_4MB",
|
||||
"requires": [
|
||||
"CONFIG_SOC_WIFI_SUPPORTED=y",
|
||||
"CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK"
|
||||
"CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK=[1-9][0-9]*"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"fqbn_append": "PartitionScheme=rainmaker_4MB",
|
||||
"requires": [
|
||||
"CONFIG_SOC_WIFI_SUPPORTED=y",
|
||||
"CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK"
|
||||
"CONFIG_ESP_RMAKER_WORK_QUEUE_TASK_STACK=[1-9][0-9]*"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"fqbn_append": "PartitionScheme=huge_app",
|
||||
"requires": [
|
||||
"CONFIG_SOC_WIFI_SUPPORTED=y"
|
||||
]
|
||||
|
|
|
|||
|
|
@ -646,6 +646,8 @@ void TwoWire::onRequestService(uint8_t num, void *arg) {
|
|||
#endif /* SOC_I2C_SUPPORT_SLAVE */
|
||||
|
||||
TwoWire Wire = TwoWire(0);
|
||||
#if SOC_I2C_NUM > 1
|
||||
TwoWire Wire1 = TwoWire(1);
|
||||
#endif /* SOC_I2C_NUM */
|
||||
|
||||
#endif /* SOC_I2C_SUPPORTED */
|
||||
|
|
|
|||
|
|
@ -144,7 +144,9 @@ public:
|
|||
};
|
||||
|
||||
extern TwoWire Wire;
|
||||
#if SOC_I2C_NUM > 1
|
||||
extern TwoWire Wire1;
|
||||
#endif /* SOC_I2C_NUM */
|
||||
|
||||
#endif /* SOC_I2C_SUPPORTED */
|
||||
#endif /* TwoWire_h */
|
||||
|
|
|
|||
|
|
@ -1,16 +1,6 @@
|
|||
{
|
||||
"fqbn": {
|
||||
"esp32c6": [
|
||||
"espressif:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed"
|
||||
],
|
||||
"esp32h2": [
|
||||
"espressif:esp32:esp32h2:PartitionScheme=zigbee,ZigbeeMode=ed"
|
||||
]
|
||||
},
|
||||
"targets": {
|
||||
"esp32": false,
|
||||
"esp32c3": false,
|
||||
"esp32s2": false,
|
||||
"esp32s3": false
|
||||
}
|
||||
"fqbn_append": "PartitionScheme=zigbee,ZigbeeMode=ed",
|
||||
"requires": [
|
||||
"CONFIG_SOC_IEEE802154_SUPPORTED=y"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,6 @@
|
|||
{
|
||||
"fqbn": {
|
||||
"esp32c6": [
|
||||
"espressif:esp32:esp32c6:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
|
||||
],
|
||||
"esp32h2": [
|
||||
"espressif:esp32:esp32h2:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
|
||||
]
|
||||
},
|
||||
"targets": {
|
||||
"esp32": false,
|
||||
"esp32c3": false,
|
||||
"esp32s2": false,
|
||||
"esp32s3": false
|
||||
}
|
||||
"fqbn_append": "PartitionScheme=zigbee_zczr,ZigbeeMode=zczr",
|
||||
"requires": [
|
||||
"CONFIG_SOC_IEEE802154_SUPPORTED=y"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,6 @@
|
|||
{
|
||||
"fqbn": {
|
||||
"esp32c6": [
|
||||
"espressif:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed"
|
||||
],
|
||||
"esp32h2": [
|
||||
"espressif:esp32:esp32h2:PartitionScheme=zigbee,ZigbeeMode=ed"
|
||||
]
|
||||
},
|
||||
"targets": {
|
||||
"esp32": false,
|
||||
"esp32c3": false,
|
||||
"esp32s2": false,
|
||||
"esp32s3": false
|
||||
}
|
||||
"fqbn_append": "PartitionScheme=zigbee,ZigbeeMode=ed",
|
||||
"requires": [
|
||||
"CONFIG_SOC_IEEE802154_SUPPORTED=y"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,6 @@
|
|||
{
|
||||
"fqbn": {
|
||||
"esp32c6": [
|
||||
"espressif:esp32:esp32c6:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
|
||||
],
|
||||
"esp32h2": [
|
||||
"espressif:esp32:esp32h2:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
|
||||
]
|
||||
},
|
||||
"targets": {
|
||||
"esp32": false,
|
||||
"esp32c3": false,
|
||||
"esp32s2": false,
|
||||
"esp32s3": false
|
||||
}
|
||||
"fqbn_append": "PartitionScheme=zigbee_zczr,ZigbeeMode=zczr",
|
||||
"requires": [
|
||||
"CONFIG_SOC_IEEE802154_SUPPORTED=y"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,6 @@
|
|||
{
|
||||
"fqbn": {
|
||||
"esp32c6": [
|
||||
"espressif:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed"
|
||||
],
|
||||
"esp32h2": [
|
||||
"espressif:esp32:esp32h2:PartitionScheme=zigbee,ZigbeeMode=ed"
|
||||
]
|
||||
},
|
||||
"targets": {
|
||||
"esp32": false,
|
||||
"esp32c3": false,
|
||||
"esp32s2": false,
|
||||
"esp32s3": false
|
||||
}
|
||||
"fqbn_append": "PartitionScheme=zigbee,ZigbeeMode=ed",
|
||||
"requires": [
|
||||
"CONFIG_SOC_IEEE802154_SUPPORTED=y"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,6 @@
|
|||
{
|
||||
"fqbn": {
|
||||
"esp32c6": [
|
||||
"espressif:esp32:esp32c6:PartitionScheme=zigbee,ZigbeeMode=ed"
|
||||
],
|
||||
"esp32h2": [
|
||||
"espressif:esp32:esp32h2:PartitionScheme=zigbee,ZigbeeMode=ed"
|
||||
]
|
||||
},
|
||||
"targets": {
|
||||
"esp32": false,
|
||||
"esp32c3": false,
|
||||
"esp32s2": false,
|
||||
"esp32s3": false
|
||||
}
|
||||
"fqbn_append": "PartitionScheme=zigbee,ZigbeeMode=ed",
|
||||
"requires": [
|
||||
"CONFIG_SOC_IEEE802154_SUPPORTED=y"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,6 @@
|
|||
{
|
||||
"fqbn": {
|
||||
"esp32c6": [
|
||||
"espressif:esp32:esp32c6:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
|
||||
],
|
||||
"esp32h2": [
|
||||
"espressif:esp32:esp32h2:PartitionScheme=zigbee_zczr,ZigbeeMode=zczr"
|
||||
]
|
||||
},
|
||||
"targets": {
|
||||
"esp32": false,
|
||||
"esp32c3": false,
|
||||
"esp32s2": false,
|
||||
"esp32s3": false
|
||||
}
|
||||
"fqbn_append": "PartitionScheme=zigbee_zczr,ZigbeeMode=zczr",
|
||||
"requires": [
|
||||
"CONFIG_SOC_IEEE802154_SUPPORTED=y"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,6 +143,10 @@ recipe.hooks.prebuild.7.pattern.windows=cmd /c type nul > "{file_opts.path}"
|
|||
recipe.hooks.core.prebuild.1.pattern.windows=cmd /c echo "-DARDUINO_CORE_BUILD" > "{file_opts.path}"
|
||||
recipe.hooks.core.postbuild.1.pattern.windows=cmd /c type nul > "{file_opts.path}"
|
||||
|
||||
# Copy sdkconfig to build folder
|
||||
recipe.hooks.prebuild.8.pattern=/usr/bin/env bash -c "cp -f "{runtime.platform.path}"/tools/esp32-arduino-libs/{build.mcu}/sdkconfig "{build.path}"/sdkconfig"
|
||||
recipe.hooks.prebuild.8.pattern.windows=cmd /c COPY /y "{runtime.platform.path}\tools\esp32-arduino-libs\{build.mcu}\sdkconfig" "{build.path}\sdkconfig"
|
||||
|
||||
## Compile c files
|
||||
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.extra_flags} {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" -DARDUINO_VARIANT="{build.variant}" -DARDUINO_PARTITION_{build.partitions} {build.extra_flags} {compiler.cpreprocessor.flags} {includes} "@{build.opt.path}" "@{file_opts.path}" "{source_file}" -o "{object_file}"
|
||||
|
||||
|
|
|
|||
6
tests/performance/linpack_double/ci.json
Normal file
6
tests/performance/linpack_double/ci.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"platforms": {
|
||||
"qemu": false,
|
||||
"wokwi": false
|
||||
}
|
||||
}
|
||||
1094
tests/performance/linpack_double/linpack_double.ino
Normal file
1094
tests/performance/linpack_double/linpack_double.ino
Normal file
File diff suppressed because it is too large
Load diff
61
tests/performance/linpack_double/test_linpack_double.py
Normal file
61
tests/performance/linpack_double/test_linpack_double.py
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
|
||||
def test_linpack_double(dut, request):
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
# Match "Runs: %d"
|
||||
res = dut.expect(r"Runs: (\d+)", timeout=60)
|
||||
runs = int(res.group(0).decode("utf-8").split(" ")[1])
|
||||
LOGGER.info("Number of runs: {}".format(runs))
|
||||
assert runs > 0, "Invalid number of runs"
|
||||
|
||||
# Match "Type: %s"
|
||||
res = dut.expect(r"Type: (\w+)", timeout=60)
|
||||
data_type = res.group(0).decode("utf-8").split(" ")[1]
|
||||
LOGGER.info("Data type: {}".format(data_type))
|
||||
assert data_type == "double", "Invalid data type"
|
||||
|
||||
# Match "Runs completed: %d"
|
||||
res = dut.expect(r"Runs completed: (\d+)", timeout=120)
|
||||
runs_completed = int(res.group(0).decode("utf-8").split(" ")[2])
|
||||
LOGGER.info("Runs completed: {}".format(runs_completed))
|
||||
assert runs_completed == runs, "Invalid number of runs completed"
|
||||
|
||||
# Match "Average MFLOPS: %f"
|
||||
res = dut.expect(r"Average MFLOPS: (\d+\.\d+)", timeout=120)
|
||||
avg_score = float(res.group(0).decode("utf-8").split(" ")[2])
|
||||
LOGGER.info("Average MFLOPS: {}".format(avg_score))
|
||||
assert avg_score > 0, "Invalid average MFLOPS"
|
||||
|
||||
# Match "Min MFLOPS: %f"
|
||||
res = dut.expect(r"Min MFLOPS: (\d+\.\d+)", timeout=120)
|
||||
min_score = float(res.group(0).decode("utf-8").split(" ")[2])
|
||||
LOGGER.info("Min MFLOPS: {}".format(min_score))
|
||||
assert min_score > 0 and min_score < 1000000000.0, "Invalid min MFLOPS"
|
||||
|
||||
# Match "Max MFLOPS: %f"
|
||||
res = dut.expect(r"Max MFLOPS: (\d+\.\d+)", timeout=120)
|
||||
max_score = float(res.group(0).decode("utf-8").split(" ")[2])
|
||||
LOGGER.info("Max MFLOPS: {}".format(max_score))
|
||||
assert max_score > 0, "Invalid max MFLOPS"
|
||||
|
||||
# Create JSON with results and write it to file
|
||||
# Always create a JSON with this format (so it can be merged later on):
|
||||
# { TEST_NAME_STR: TEST_RESULTS_DICT }
|
||||
results = {"linpack_double": {"runs": runs, "avg_score": avg_score, "min_score": min_score, "max_score": max_score}}
|
||||
|
||||
current_folder = os.path.dirname(request.path)
|
||||
file_index = 0
|
||||
report_file = os.path.join(current_folder, "result_linpack_double" + str(file_index) + ".json")
|
||||
while os.path.exists(report_file):
|
||||
report_file = report_file.replace(str(file_index) + ".json", str(file_index + 1) + ".json")
|
||||
file_index += 1
|
||||
|
||||
with open(report_file, "w") as f:
|
||||
try:
|
||||
f.write(json.dumps(results))
|
||||
except Exception as e:
|
||||
LOGGER.warning("Failed to write results to file: {}".format(e))
|
||||
6
tests/performance/linpack_float/ci.json
Normal file
6
tests/performance/linpack_float/ci.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"platforms": {
|
||||
"qemu": false,
|
||||
"wokwi": false
|
||||
}
|
||||
}
|
||||
1094
tests/performance/linpack_float/linpack_float.ino
Normal file
1094
tests/performance/linpack_float/linpack_float.ino
Normal file
File diff suppressed because it is too large
Load diff
61
tests/performance/linpack_float/test_linpack_float.py
Normal file
61
tests/performance/linpack_float/test_linpack_float.py
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import json
|
||||
import logging
|
||||
import os
|
||||
|
||||
|
||||
def test_linpack_float(dut, request):
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
# Match "Runs: %d"
|
||||
res = dut.expect(r"Runs: (\d+)", timeout=60)
|
||||
runs = int(res.group(0).decode("utf-8").split(" ")[1])
|
||||
LOGGER.info("Number of runs: {}".format(runs))
|
||||
assert runs > 0, "Invalid number of runs"
|
||||
|
||||
# Match "Type: %s"
|
||||
res = dut.expect(r"Type: (\w+)", timeout=60)
|
||||
data_type = res.group(0).decode("utf-8").split(" ")[1]
|
||||
LOGGER.info("Data type: {}".format(data_type))
|
||||
assert data_type == "float", "Invalid data type"
|
||||
|
||||
# Match "Runs completed: %d"
|
||||
res = dut.expect(r"Runs completed: (\d+)", timeout=120)
|
||||
runs_completed = int(res.group(0).decode("utf-8").split(" ")[2])
|
||||
LOGGER.info("Runs completed: {}".format(runs_completed))
|
||||
assert runs_completed == runs, "Invalid number of runs completed"
|
||||
|
||||
# Match "Average MFLOPS: %f"
|
||||
res = dut.expect(r"Average MFLOPS: (\d+\.\d+)", timeout=120)
|
||||
avg_score = float(res.group(0).decode("utf-8").split(" ")[2])
|
||||
LOGGER.info("Average MFLOPS: {}".format(avg_score))
|
||||
assert avg_score > 0, "Invalid average MFLOPS"
|
||||
|
||||
# Match "Min MFLOPS: %f"
|
||||
res = dut.expect(r"Min MFLOPS: (\d+\.\d+)", timeout=120)
|
||||
min_score = float(res.group(0).decode("utf-8").split(" ")[2])
|
||||
LOGGER.info("Min MFLOPS: {}".format(min_score))
|
||||
assert min_score > 0 and min_score < 1000000000.0, "Invalid min MFLOPS"
|
||||
|
||||
# Match "Max MFLOPS: %f"
|
||||
res = dut.expect(r"Max MFLOPS: (\d+\.\d+)", timeout=120)
|
||||
max_score = float(res.group(0).decode("utf-8").split(" ")[2])
|
||||
LOGGER.info("Max MFLOPS: {}".format(max_score))
|
||||
assert max_score > 0, "Invalid max MFLOPS"
|
||||
|
||||
# Create JSON with results and write it to file
|
||||
# Always create a JSON with this format (so it can be merged later on):
|
||||
# { TEST_NAME_STR: TEST_RESULTS_DICT }
|
||||
results = {"linpack_float": {"runs": runs, "avg_score": avg_score, "min_score": min_score, "max_score": max_score}}
|
||||
|
||||
current_folder = os.path.dirname(request.path)
|
||||
file_index = 0
|
||||
report_file = os.path.join(current_folder, "result_linpack_float" + str(file_index) + ".json")
|
||||
while os.path.exists(report_file):
|
||||
report_file = report_file.replace(str(file_index) + ".json", str(file_index + 1) + ".json")
|
||||
file_index += 1
|
||||
|
||||
with open(report_file, "w") as f:
|
||||
try:
|
||||
f.write(json.dumps(results))
|
||||
except Exception as e:
|
||||
LOGGER.warning("Failed to write results to file: {}".format(e))
|
||||
14
tests/validation/psram/ci.json
Normal file
14
tests/validation/psram/ci.json
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"platforms": {
|
||||
"qemu": false,
|
||||
"wokwi": false
|
||||
},
|
||||
"requires": [
|
||||
"CONFIG_SPIRAM=y"
|
||||
],
|
||||
"targets": {
|
||||
"esp32c3": false,
|
||||
"esp32c6": false,
|
||||
"esp32h2": false
|
||||
}
|
||||
}
|
||||
112
tests/validation/psram/psram.ino
Normal file
112
tests/validation/psram/psram.ino
Normal file
|
|
@ -0,0 +1,112 @@
|
|||
#include <Arduino.h>
|
||||
#include <unity.h>
|
||||
|
||||
#define MAX_TEST_SIZE 512 * 1024 // 512KB
|
||||
|
||||
void *buf = NULL;
|
||||
|
||||
void test_malloc_success(void) {
|
||||
buf = ps_malloc(MAX_TEST_SIZE);
|
||||
TEST_ASSERT_NOT_NULL(buf);
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
|
||||
void test_calloc_success(void) {
|
||||
buf = ps_calloc(MAX_TEST_SIZE, 1);
|
||||
TEST_ASSERT_NOT_NULL(buf);
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
|
||||
void test_realloc_success(void) {
|
||||
buf = ps_malloc(MAX_TEST_SIZE);
|
||||
TEST_ASSERT_NOT_NULL(buf);
|
||||
buf = ps_realloc(buf, MAX_TEST_SIZE + 1024);
|
||||
TEST_ASSERT_NOT_NULL(buf);
|
||||
free(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
|
||||
void test_malloc_fail(void) {
|
||||
buf = ps_malloc(0xFFFFFFFF);
|
||||
TEST_ASSERT_NULL(buf);
|
||||
}
|
||||
|
||||
void test_memset_all_zeroes(void) {
|
||||
memset(buf, 0, MAX_TEST_SIZE);
|
||||
for (size_t i = 0; i < MAX_TEST_SIZE; i++) {
|
||||
TEST_ASSERT_EQUAL(0, ((uint8_t *)buf)[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void test_memset_all_ones(void) {
|
||||
memset(buf, 0xFF, MAX_TEST_SIZE);
|
||||
for (size_t i = 0; i < MAX_TEST_SIZE; i++) {
|
||||
TEST_ASSERT_EQUAL(0xFF, ((uint8_t *)buf)[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void test_memset_alternating(void) {
|
||||
for (size_t i = 0; i < MAX_TEST_SIZE; i++) {
|
||||
((uint8_t *)buf)[i] = i % 2 == 0 ? 0x00 : 0xFF;
|
||||
}
|
||||
memset(buf, 0xAA, MAX_TEST_SIZE);
|
||||
for (size_t i = 0; i < MAX_TEST_SIZE; i++) {
|
||||
TEST_ASSERT_EQUAL(0xAA, ((uint8_t *)buf)[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void test_memset_random(void) {
|
||||
for (size_t i = 0; i < MAX_TEST_SIZE; i++) {
|
||||
((uint8_t *)buf)[i] = random(0, 256);
|
||||
}
|
||||
memset(buf, 0x55, MAX_TEST_SIZE);
|
||||
for (size_t i = 0; i < MAX_TEST_SIZE; i++) {
|
||||
TEST_ASSERT_EQUAL(0x55, ((uint8_t *)buf)[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void test_memcpy(void) {
|
||||
void *buf2 = malloc(1024); // 1KB
|
||||
TEST_ASSERT_NOT_NULL(buf2);
|
||||
memset(buf, 0x55, MAX_TEST_SIZE);
|
||||
memset(buf2, 0xAA, 1024);
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpointer-arith"
|
||||
|
||||
for (size_t i = 0; i < MAX_TEST_SIZE; i += 1024) {
|
||||
memcpy(buf + i, buf2, 1024);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < MAX_TEST_SIZE; i += 1024) {
|
||||
TEST_ASSERT_NULL(memcmp(buf + i, buf2, 1024));
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
free(buf2);
|
||||
}
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
while (!Serial) {
|
||||
delay(10);
|
||||
}
|
||||
|
||||
UNITY_BEGIN();
|
||||
RUN_TEST(test_malloc_success);
|
||||
RUN_TEST(test_malloc_fail);
|
||||
RUN_TEST(test_calloc_success);
|
||||
RUN_TEST(test_realloc_success);
|
||||
buf = ps_malloc(MAX_TEST_SIZE);
|
||||
RUN_TEST(test_memset_all_zeroes);
|
||||
RUN_TEST(test_memset_all_ones);
|
||||
RUN_TEST(test_memset_alternating);
|
||||
RUN_TEST(test_memset_random);
|
||||
RUN_TEST(test_memcpy);
|
||||
UNITY_END();
|
||||
}
|
||||
|
||||
void loop() {}
|
||||
2
tests/validation/psram/test_psram.py
Normal file
2
tests/validation/psram/test_psram.py
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
def test_psram(dut):
|
||||
dut.expect_unity_test_output(timeout=120)
|
||||
31
variants/BharatPi-A7672S-4G/pins_arduino.h
Normal file
31
variants/BharatPi-A7672S-4G/pins_arduino.h
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
|
||||
|
||||
static const uint8_t A0 = 14;
|
||||
static const uint8_t A1 = 13;
|
||||
static const uint8_t A2 = 12;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 2;
|
||||
static const uint8_t A5 = 0;
|
||||
|
||||
static const uint8_t TX = 1;
|
||||
static const uint8_t RX = 3;
|
||||
|
||||
static const uint8_t TX_4G = 17;
|
||||
static const uint8_t RX_4G = 16;
|
||||
|
||||
static const uint8_t SDA = 21;
|
||||
static const uint8_t SCL = 22;
|
||||
|
||||
static const uint8_t SS = 5;
|
||||
static const uint8_t MOSI = 23;
|
||||
static const uint8_t MISO = 19;
|
||||
static const uint8_t SCK = 18;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
35
variants/BharatPi-LoRa/pins_arduino.h
Normal file
35
variants/BharatPi-LoRa/pins_arduino.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
|
||||
|
||||
static const uint8_t A0 = 14;
|
||||
static const uint8_t A1 = 13;
|
||||
static const uint8_t A2 = 12;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 2;
|
||||
static const uint8_t A5 = 0;
|
||||
|
||||
static const uint8_t TX = 1;
|
||||
static const uint8_t RX = 3;
|
||||
|
||||
static const uint8_t TX2 = 17;
|
||||
static const uint8_t RX2 = 16;
|
||||
|
||||
static const uint8_t LORA_SS = 4;
|
||||
static const uint8_t RST = 14;
|
||||
static const uint8_t DIO0 = 2;
|
||||
|
||||
static const uint8_t SDA = 21;
|
||||
static const uint8_t SCL = 22;
|
||||
|
||||
static const uint8_t SS = 5;
|
||||
static const uint8_t MOSI = 23;
|
||||
static const uint8_t MISO = 19;
|
||||
static const uint8_t SCK = 18;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
35
variants/BharatPi-Node-Wifi/pins_arduino.h
Normal file
35
variants/BharatPi-Node-Wifi/pins_arduino.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
static const uint8_t LED_BUILTIN = 2;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
|
||||
|
||||
static const uint8_t SAFFRON_LED = 12;
|
||||
static const uint8_t WHITE_LED = 2;
|
||||
static const uint8_t GREEN_LED = 13;
|
||||
|
||||
static const uint8_t A0 = 14;
|
||||
static const uint8_t A1 = 13;
|
||||
static const uint8_t A2 = 12;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 2;
|
||||
static const uint8_t A5 = 0;
|
||||
|
||||
static const uint8_t TX = 1;
|
||||
static const uint8_t RX = 3;
|
||||
|
||||
static const uint8_t TX2 = 17;
|
||||
static const uint8_t RX2 = 16;
|
||||
|
||||
static const uint8_t SDA = 21;
|
||||
static const uint8_t SCL = 22;
|
||||
|
||||
static const uint8_t SS = 5;
|
||||
static const uint8_t MOSI = 23;
|
||||
static const uint8_t MISO = 19;
|
||||
static const uint8_t SCK = 18;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
78
variants/atd35s3/pins_arduino.h
Normal file
78
variants/atd35s3/pins_arduino.h
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x1001
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
static const uint8_t SDA = 8;
|
||||
static const uint8_t SCL = 9;
|
||||
|
||||
static const uint8_t SS = 10;
|
||||
static const uint8_t MOSI = 11;
|
||||
static const uint8_t MISO = 13;
|
||||
static const uint8_t SCK = 12;
|
||||
|
||||
// LCD pin
|
||||
#define LCD_CS SS
|
||||
#define LCD_SCK SCK
|
||||
#define LCD_SDA MOSI
|
||||
static const uint8_t LCD_DC = 21;
|
||||
static const uint8_t LCD_RES = 14;
|
||||
static const uint8_t LCD_BL = 3;
|
||||
|
||||
// MicroSD Card pin
|
||||
static const uint8_t SD_CS = 18;
|
||||
static const uint8_t SD_CD = 17;
|
||||
|
||||
static const uint8_t BTN_A = 4;
|
||||
#define KEY_BUILTIN BTN_A
|
||||
|
||||
static const uint8_t LED_BUILTIN = 5;
|
||||
|
||||
// DAC pin
|
||||
static const uint8_t DAC_DIN = 47;
|
||||
static const uint8_t DAC_BCLK = 48;
|
||||
static const uint8_t DAC_WS = 45;
|
||||
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
static const uint8_t A7 = 8;
|
||||
static const uint8_t A8 = 9;
|
||||
static const uint8_t A9 = 10;
|
||||
static const uint8_t A10 = 11;
|
||||
static const uint8_t A11 = 12;
|
||||
static const uint8_t A12 = 13;
|
||||
static const uint8_t A13 = 14;
|
||||
static const uint8_t A14 = 15;
|
||||
static const uint8_t A15 = 16;
|
||||
static const uint8_t A16 = 17;
|
||||
static const uint8_t A17 = 18;
|
||||
static const uint8_t A18 = 19;
|
||||
static const uint8_t A19 = 20;
|
||||
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
static const uint8_t T8 = 8;
|
||||
static const uint8_t T9 = 9;
|
||||
static const uint8_t T10 = 10;
|
||||
static const uint8_t T11 = 11;
|
||||
static const uint8_t T12 = 12;
|
||||
static const uint8_t T13 = 13;
|
||||
static const uint8_t T14 = 14;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
52
variants/cezerio_dev_esp32c6/pins_arduino.h
Normal file
52
variants/cezerio_dev_esp32c6/pins_arduino.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
#define USB_VID 0x303A
|
||||
#define USB_PID 0x1001
|
||||
#define USB_MANUFACTURER "RFtek Electronics"
|
||||
#define USB_PRODUCT "cezerio dev ESP32C6"
|
||||
#define USB_SERIAL ""
|
||||
|
||||
#define PIN_RGB_LED 3
|
||||
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
|
||||
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
|
||||
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
|
||||
#define RGB_BUILTIN LED_BUILTIN
|
||||
#define RGBLED LED_BUILTIN
|
||||
#define RGB_BRIGHTNESS 64
|
||||
|
||||
static const uint8_t BUT_BUILTIN = 9;
|
||||
#define BUILTIN_BUT BUT_BUILTIN // backward compatibility
|
||||
#define BUT_BUILTIN BUT_BUILTIN // allow testing #ifdef BUT_BUILTIN
|
||||
#define BOOT BUT_BUILTIN
|
||||
|
||||
static const uint8_t TX = 16;
|
||||
static const uint8_t RX = 17;
|
||||
|
||||
static const uint8_t SDA = 8;
|
||||
static const uint8_t SCL = 7;
|
||||
|
||||
static const uint8_t SS = 14;
|
||||
static const uint8_t MOSI = 22;
|
||||
static const uint8_t MISO = 23;
|
||||
static const uint8_t SCK = 21;
|
||||
|
||||
static const uint8_t A0 = 0;
|
||||
static const uint8_t A1 = 1;
|
||||
static const uint8_t A2 = 2;
|
||||
static const uint8_t A3 = 3;
|
||||
static const uint8_t A4 = 4;
|
||||
static const uint8_t A5 = 5;
|
||||
static const uint8_t A6 = 6;
|
||||
|
||||
static const uint8_t MATRIX = 18;
|
||||
|
||||
static const uint8_t IMUSD = 8;
|
||||
static const uint8_t IMUSC = 7;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
35
variants/ioxesp32c6/pins_arduino.h
Normal file
35
variants/ioxesp32c6/pins_arduino.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
#define PIN_RGB_LED 8
|
||||
// BUILTIN_LED can be used in new Arduino API digitalWrite() like in Blink.ino
|
||||
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT + PIN_RGB_LED;
|
||||
#define BUILTIN_LED LED_BUILTIN // backward compatibility
|
||||
#define LED_BUILTIN LED_BUILTIN // allow testing #ifdef LED_BUILTIN
|
||||
// RGB_BUILTIN and RGB_BRIGHTNESS can be used in new Arduino API rgbLedWrite()
|
||||
#define RGB_BUILTIN LED_BUILTIN
|
||||
#define RGB_BRIGHTNESS 64
|
||||
|
||||
static const uint8_t TX = 16;
|
||||
static const uint8_t RX = 17;
|
||||
|
||||
static const uint8_t SDA = 21;
|
||||
static const uint8_t SCL = 22;
|
||||
|
||||
static const uint8_t SS = 18;
|
||||
static const uint8_t MOSI = 23;
|
||||
static const uint8_t MISO = 20;
|
||||
static const uint8_t SCK = 19;
|
||||
|
||||
static const uint8_t A0 = 0;
|
||||
static const uint8_t A1 = 1;
|
||||
static const uint8_t A2 = 2;
|
||||
static const uint8_t A3 = 3;
|
||||
static const uint8_t A4 = 4;
|
||||
static const uint8_t A5 = 5;
|
||||
static const uint8_t A6 = 6;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
87
variants/waveshare_esp32_s3_touch_amoled_18/pins_arduino.h
Normal file
87
variants/waveshare_esp32_s3_touch_amoled_18/pins_arduino.h
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
// BN: ESP32 Family Device
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x8255
|
||||
|
||||
#define USB_MANUFACTURER "Waveshare"
|
||||
#define USB_PRODUCT "ESP32-S3-Touch-AMOLED-1.8"
|
||||
#define USB_SERIAL ""
|
||||
|
||||
// display for SH8601
|
||||
#define WS_LCD_CS 12
|
||||
#define WS_QSPI_SIO0 4
|
||||
#define WS_QSPI_SI1 5
|
||||
#define WS_QSPI_SI2 6
|
||||
#define WS_QSPI_SI3 7
|
||||
#define WS_QSPI_SCL 11
|
||||
|
||||
// Touch for FT3168
|
||||
#define WS_TP_INT 21
|
||||
|
||||
// Onboard Electric buzzer & Custom buttons
|
||||
// GPIO and PSRAM conflict, need to pay attention when using
|
||||
|
||||
// UART0 pins
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
// Def for I2C that shares the IMU I2C pins
|
||||
static const uint8_t SDA = 14;
|
||||
static const uint8_t SCL = 15;
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for SPI2
|
||||
static const uint8_t SS = 34; // FSPICS0
|
||||
static const uint8_t MOSI = 35; // FSPID
|
||||
static const uint8_t MISO = 37; // FSPIQ
|
||||
static const uint8_t SCK = 36; // FSPICLK
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for OUTPUT
|
||||
static const uint8_t OUTPUT_IO2 = 2;
|
||||
static const uint8_t OUTPUT_IO3 = 3;
|
||||
static const uint8_t OUTPUT_IO17 = 17;
|
||||
static const uint8_t OUTPUT_IO18 = 18;
|
||||
|
||||
// Analog capable pins on the header
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
|
||||
// GPIO capable pins on the header
|
||||
static const uint8_t D0 = 7;
|
||||
static const uint8_t D1 = 6;
|
||||
static const uint8_t D2 = 5;
|
||||
static const uint8_t D3 = 4;
|
||||
static const uint8_t D4 = 3;
|
||||
static const uint8_t D5 = 2;
|
||||
static const uint8_t D6 = 1;
|
||||
static const uint8_t D7 = 44;
|
||||
static const uint8_t D8 = 43;
|
||||
static const uint8_t D9 = 40;
|
||||
static const uint8_t D10 = 39;
|
||||
static const uint8_t D11 = 38;
|
||||
static const uint8_t D12 = 37;
|
||||
static const uint8_t D13 = 36;
|
||||
static const uint8_t D14 = 35;
|
||||
static const uint8_t D15 = 34;
|
||||
static const uint8_t D16 = 33;
|
||||
|
||||
// Touch input capable pins on the header
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
64
variants/waveshare_esp32_s3_touch_lcd_185/pins_arduino.h
Normal file
64
variants/waveshare_esp32_s3_touch_lcd_185/pins_arduino.h
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
// BN: ESP32 Family Device
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x8290
|
||||
|
||||
#define USB_MANUFACTURER "Waveshare"
|
||||
#define USB_PRODUCT "ESP32-S3-Touch-LCD-1.85"
|
||||
#define USB_SERIAL ""
|
||||
|
||||
// I2C pins
|
||||
static const uint8_t SCL = 10;
|
||||
static const uint8_t SDA = 11;
|
||||
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for SPI2
|
||||
static const uint8_t SS = 34; // FSPICS0
|
||||
static const uint8_t MOSI = 35; // FSPID
|
||||
static const uint8_t MISO = 37; // FSPIQ
|
||||
static const uint8_t SCK = 36; // FSPICLK
|
||||
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
static const uint8_t A7 = 8;
|
||||
static const uint8_t A8 = 9;
|
||||
static const uint8_t A9 = 10;
|
||||
static const uint8_t A10 = 11;
|
||||
static const uint8_t A11 = 12;
|
||||
static const uint8_t A12 = 13;
|
||||
static const uint8_t A13 = 14;
|
||||
static const uint8_t A14 = 15;
|
||||
static const uint8_t A15 = 16;
|
||||
static const uint8_t A16 = 17;
|
||||
static const uint8_t A17 = 18;
|
||||
static const uint8_t A18 = 19;
|
||||
static const uint8_t A19 = 20;
|
||||
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
static const uint8_t T8 = 8;
|
||||
static const uint8_t T9 = 9;
|
||||
static const uint8_t T10 = 10;
|
||||
static const uint8_t T11 = 11;
|
||||
static const uint8_t T12 = 12;
|
||||
static const uint8_t T13 = 13;
|
||||
static const uint8_t T14 = 14;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
73
variants/waveshare_esp32_s3_touch_lcd_4/pins_arduino.h
Normal file
73
variants/waveshare_esp32_s3_touch_lcd_4/pins_arduino.h
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
// BN: ESP32 Family Device
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x823D
|
||||
|
||||
#define USB_MANUFACTURER "Waveshare"
|
||||
#define USB_PRODUCT "ESP32-S3-Touch-LCD-4"
|
||||
#define USB_SERIAL ""
|
||||
|
||||
// UART0 pins
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
// Def for I2C that shares the IMU I2C pins
|
||||
static const uint8_t SDA = -1;
|
||||
static const uint8_t SCL = -1;
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for SPI2
|
||||
static const uint8_t SS = 34; // FSPICS0
|
||||
static const uint8_t MOSI = 35; // FSPID
|
||||
static const uint8_t MISO = 37; // FSPIQ
|
||||
static const uint8_t SCK = 36; // FSPICLK
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for OUTPUT
|
||||
static const uint8_t OUTPUT_IO2 = 2;
|
||||
static const uint8_t OUTPUT_IO3 = 3;
|
||||
static const uint8_t OUTPUT_IO17 = 17;
|
||||
static const uint8_t OUTPUT_IO18 = 18;
|
||||
|
||||
// Analog capable pins on the header
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
|
||||
// GPIO capable pins on the header
|
||||
static const uint8_t D0 = 7;
|
||||
static const uint8_t D1 = 6;
|
||||
static const uint8_t D2 = 5;
|
||||
static const uint8_t D3 = 4;
|
||||
static const uint8_t D4 = 3;
|
||||
static const uint8_t D5 = 2;
|
||||
static const uint8_t D6 = 1;
|
||||
static const uint8_t D7 = 44;
|
||||
static const uint8_t D8 = 43;
|
||||
static const uint8_t D9 = 40;
|
||||
static const uint8_t D10 = 39;
|
||||
static const uint8_t D11 = 38;
|
||||
static const uint8_t D12 = 37;
|
||||
static const uint8_t D13 = 36;
|
||||
static const uint8_t D14 = 35;
|
||||
static const uint8_t D15 = 34;
|
||||
static const uint8_t D16 = 33;
|
||||
|
||||
// Touch input capable pins on the header
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
116
variants/waveshare_esp32_s3_touch_lcd_43/pins_arduino.h
Normal file
116
variants/waveshare_esp32_s3_touch_lcd_43/pins_arduino.h
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
// BN: ESP32 Family Device
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x822E
|
||||
|
||||
#define USB_MANUFACTURER "Waveshare"
|
||||
#define USB_PRODUCT "ESP32-S3-Touch-LCD-4.3"
|
||||
#define USB_SERIAL ""
|
||||
|
||||
// display for ST7262
|
||||
#define WS_LCD_B3 14
|
||||
#define WS_LCD_B4 38
|
||||
#define WS_LCD_B5 18
|
||||
#define WS_LCD_B6 17
|
||||
#define WS_LCD_B7 10
|
||||
|
||||
#define WS_LCD_G2 39
|
||||
#define WS_LCD_G3 0
|
||||
#define WS_LCD_G4 45
|
||||
#define WS_LCD_G5 48
|
||||
#define WS_LCD_G6 47
|
||||
#define WS_LCD_G7 21
|
||||
|
||||
#define WS_LCD_R3 1
|
||||
#define WS_LCD_R4 2
|
||||
#define WS_LCD_R5 42
|
||||
#define WS_LCD_R6 41
|
||||
#define WS_LCD_R7 40
|
||||
|
||||
#define WS_LCD_VSYNC 3
|
||||
#define WS_LCD_HSYNC 46
|
||||
#define WS_LCD_PCLK 7
|
||||
#define WS_LCD_DE 5
|
||||
|
||||
// Touch for gt911
|
||||
#define WS_TP_SDA 8
|
||||
#define WS_TP_SCL 9
|
||||
#define WS_TP_RST -1
|
||||
#define WS_TP_INT 4
|
||||
|
||||
//RS485
|
||||
#define WS_RS485_RXD 16
|
||||
#define WS_RS485_TXD 15
|
||||
|
||||
//CAN
|
||||
#define WS_CAN_RXD 19
|
||||
#define WS_CAN_TXD 20
|
||||
|
||||
//Onboard CH422G IO expander
|
||||
#define WS_CH422G_SDA 8
|
||||
#define WS_CH422G_SCL 9
|
||||
|
||||
// UART0 pins
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
// Def for I2C that shares the IMU I2C pins
|
||||
static const uint8_t SDA = 11;
|
||||
static const uint8_t SCL = 10;
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for SPI2
|
||||
static const uint8_t SS = 34; // FSPICS0
|
||||
static const uint8_t MOSI = 35; // FSPID
|
||||
static const uint8_t MISO = 37; // FSPIQ
|
||||
static const uint8_t SCK = 36; // FSPICLK
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for OUTPUT
|
||||
static const uint8_t OUTPUT_IO2 = 2;
|
||||
static const uint8_t OUTPUT_IO3 = 3;
|
||||
static const uint8_t OUTPUT_IO17 = 17;
|
||||
static const uint8_t OUTPUT_IO18 = 18;
|
||||
|
||||
// Analog capable pins on the header
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
|
||||
// GPIO capable pins on the header
|
||||
static const uint8_t D0 = 7;
|
||||
static const uint8_t D1 = 6;
|
||||
static const uint8_t D2 = 5;
|
||||
static const uint8_t D3 = 4;
|
||||
static const uint8_t D4 = 3;
|
||||
static const uint8_t D5 = 2;
|
||||
static const uint8_t D6 = 1;
|
||||
static const uint8_t D7 = 44;
|
||||
static const uint8_t D8 = 43;
|
||||
static const uint8_t D9 = 40;
|
||||
static const uint8_t D10 = 39;
|
||||
static const uint8_t D11 = 38;
|
||||
static const uint8_t D12 = 37;
|
||||
static const uint8_t D13 = 36;
|
||||
static const uint8_t D14 = 35;
|
||||
static const uint8_t D15 = 34;
|
||||
static const uint8_t D16 = 33;
|
||||
|
||||
// Touch input capable pins on the header
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
116
variants/waveshare_esp32_s3_touch_lcd_43b/pins_arduino.h
Normal file
116
variants/waveshare_esp32_s3_touch_lcd_43b/pins_arduino.h
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
// BN: ESP32 Family Device
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x8231
|
||||
|
||||
#define USB_MANUFACTURER "Waveshare"
|
||||
#define USB_PRODUCT "ESP32-S3-Touch-LCD-4.3B"
|
||||
#define USB_SERIAL ""
|
||||
|
||||
// display for ST7262
|
||||
#define WS_LCD_B3 14
|
||||
#define WS_LCD_B4 38
|
||||
#define WS_LCD_B5 18
|
||||
#define WS_LCD_B6 17
|
||||
#define WS_LCD_B7 10
|
||||
|
||||
#define WS_LCD_G2 39
|
||||
#define WS_LCD_G3 0
|
||||
#define WS_LCD_G4 45
|
||||
#define WS_LCD_G5 48
|
||||
#define WS_LCD_G6 47
|
||||
#define WS_LCD_G7 21
|
||||
|
||||
#define WS_LCD_R3 1
|
||||
#define WS_LCD_R4 2
|
||||
#define WS_LCD_R5 42
|
||||
#define WS_LCD_R6 41
|
||||
#define WS_LCD_R7 40
|
||||
|
||||
#define WS_LCD_VSYNC 3
|
||||
#define WS_LCD_HSYNC 46
|
||||
#define WS_LCD_PCLK 7
|
||||
#define WS_LCD_DE 5
|
||||
|
||||
// Touch for gt911
|
||||
#define WS_TP_SDA 8
|
||||
#define WS_TP_SCL 9
|
||||
#define WS_TP_RST -1
|
||||
#define WS_TP_INT 4
|
||||
|
||||
//RS485
|
||||
#define WS_RS485_RXD 43
|
||||
#define WS_RS485_TXD 44
|
||||
|
||||
//CAN
|
||||
#define WS_CAN_RXD 15
|
||||
#define WS_CAN_TXD 16
|
||||
|
||||
//Onboard CH422G IO expander
|
||||
#define WS_CH422G_SDA 8
|
||||
#define WS_CH422G_SCL 9
|
||||
|
||||
// UART0 pins
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
// Def for I2C that shares the IMU I2C pins
|
||||
static const uint8_t SDA = 11;
|
||||
static const uint8_t SCL = 10;
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for SPI2
|
||||
static const uint8_t SS = 34; // FSPICS0
|
||||
static const uint8_t MOSI = 35; // FSPID
|
||||
static const uint8_t MISO = 37; // FSPIQ
|
||||
static const uint8_t SCK = 36; // FSPICLK
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for OUTPUT
|
||||
static const uint8_t OUTPUT_IO2 = 2;
|
||||
static const uint8_t OUTPUT_IO3 = 3;
|
||||
static const uint8_t OUTPUT_IO17 = 17;
|
||||
static const uint8_t OUTPUT_IO18 = 18;
|
||||
|
||||
// Analog capable pins on the header
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
|
||||
// GPIO capable pins on the header
|
||||
static const uint8_t D0 = 7;
|
||||
static const uint8_t D1 = 6;
|
||||
static const uint8_t D2 = 5;
|
||||
static const uint8_t D3 = 4;
|
||||
static const uint8_t D4 = 3;
|
||||
static const uint8_t D5 = 2;
|
||||
static const uint8_t D6 = 1;
|
||||
static const uint8_t D7 = 44;
|
||||
static const uint8_t D8 = 43;
|
||||
static const uint8_t D9 = 40;
|
||||
static const uint8_t D10 = 39;
|
||||
static const uint8_t D11 = 38;
|
||||
static const uint8_t D12 = 37;
|
||||
static const uint8_t D13 = 36;
|
||||
static const uint8_t D14 = 35;
|
||||
static const uint8_t D15 = 34;
|
||||
static const uint8_t D16 = 33;
|
||||
|
||||
// Touch input capable pins on the header
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
116
variants/waveshare_esp32_s3_touch_lcd_5/pins_arduino.h
Normal file
116
variants/waveshare_esp32_s3_touch_lcd_5/pins_arduino.h
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
// BN: ESP32 Family Device
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x8237
|
||||
|
||||
#define USB_MANUFACTURER "Waveshare"
|
||||
#define USB_PRODUCT "ESP32-S3-Touch-LCD-5"
|
||||
#define USB_SERIAL ""
|
||||
|
||||
// display for ST7262
|
||||
#define WS_LCD_B3 14
|
||||
#define WS_LCD_B4 38
|
||||
#define WS_LCD_B5 18
|
||||
#define WS_LCD_B6 17
|
||||
#define WS_LCD_B7 10
|
||||
|
||||
#define WS_LCD_G2 39
|
||||
#define WS_LCD_G3 0
|
||||
#define WS_LCD_G4 45
|
||||
#define WS_LCD_G5 48
|
||||
#define WS_LCD_G6 47
|
||||
#define WS_LCD_G7 21
|
||||
|
||||
#define WS_LCD_R3 1
|
||||
#define WS_LCD_R4 2
|
||||
#define WS_LCD_R5 42
|
||||
#define WS_LCD_R6 41
|
||||
#define WS_LCD_R7 40
|
||||
|
||||
#define WS_LCD_VSYNC 3
|
||||
#define WS_LCD_HSYNC 46
|
||||
#define WS_LCD_PCLK 7
|
||||
#define WS_LCD_DE 5
|
||||
|
||||
// Touch for gt911
|
||||
#define WS_TP_SDA 8
|
||||
#define WS_TP_SCL 9
|
||||
#define WS_TP_RST -1
|
||||
#define WS_TP_INT 4
|
||||
|
||||
//RS485
|
||||
#define WS_RS485_RXD 43
|
||||
#define WS_RS485_TXD 44
|
||||
|
||||
//CAN
|
||||
#define WS_CAN_RXD 15
|
||||
#define WS_CAN_TXD 16
|
||||
|
||||
//Onboard CH422G IO expander
|
||||
#define WS_CH422G_SDA 8
|
||||
#define WS_CH422G_SCL 9
|
||||
|
||||
// UART0 pins
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
// Def for I2C that shares the IMU I2C pins
|
||||
static const uint8_t SDA = 11;
|
||||
static const uint8_t SCL = 10;
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for SPI2
|
||||
static const uint8_t SS = 34; // FSPICS0
|
||||
static const uint8_t MOSI = 35; // FSPID
|
||||
static const uint8_t MISO = 37; // FSPIQ
|
||||
static const uint8_t SCK = 36; // FSPICLK
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for OUTPUT
|
||||
static const uint8_t OUTPUT_IO2 = 2;
|
||||
static const uint8_t OUTPUT_IO3 = 3;
|
||||
static const uint8_t OUTPUT_IO17 = 17;
|
||||
static const uint8_t OUTPUT_IO18 = 18;
|
||||
|
||||
// Analog capable pins on the header
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
|
||||
// GPIO capable pins on the header
|
||||
static const uint8_t D0 = 7;
|
||||
static const uint8_t D1 = 6;
|
||||
static const uint8_t D2 = 5;
|
||||
static const uint8_t D3 = 4;
|
||||
static const uint8_t D4 = 3;
|
||||
static const uint8_t D5 = 2;
|
||||
static const uint8_t D6 = 1;
|
||||
static const uint8_t D7 = 44;
|
||||
static const uint8_t D8 = 43;
|
||||
static const uint8_t D9 = 40;
|
||||
static const uint8_t D10 = 39;
|
||||
static const uint8_t D11 = 38;
|
||||
static const uint8_t D12 = 37;
|
||||
static const uint8_t D13 = 36;
|
||||
static const uint8_t D14 = 35;
|
||||
static const uint8_t D15 = 34;
|
||||
static const uint8_t D16 = 33;
|
||||
|
||||
// Touch input capable pins on the header
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
116
variants/waveshare_esp32_s3_touch_lcd_5b/pins_arduino.h
Normal file
116
variants/waveshare_esp32_s3_touch_lcd_5b/pins_arduino.h
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
// BN: ESP32 Family Device
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x823A
|
||||
|
||||
#define USB_MANUFACTURER "Waveshare"
|
||||
#define USB_PRODUCT "ESP32-S3-Touch-LCD-5B"
|
||||
#define USB_SERIAL ""
|
||||
|
||||
// display for ST7262
|
||||
#define WS_LCD_B3 14
|
||||
#define WS_LCD_B4 38
|
||||
#define WS_LCD_B5 18
|
||||
#define WS_LCD_B6 17
|
||||
#define WS_LCD_B7 10
|
||||
|
||||
#define WS_LCD_G2 39
|
||||
#define WS_LCD_G3 0
|
||||
#define WS_LCD_G4 45
|
||||
#define WS_LCD_G5 48
|
||||
#define WS_LCD_G6 47
|
||||
#define WS_LCD_G7 21
|
||||
|
||||
#define WS_LCD_R3 1
|
||||
#define WS_LCD_R4 2
|
||||
#define WS_LCD_R5 42
|
||||
#define WS_LCD_R6 41
|
||||
#define WS_LCD_R7 40
|
||||
|
||||
#define WS_LCD_VSYNC 3
|
||||
#define WS_LCD_HSYNC 46
|
||||
#define WS_LCD_PCLK 7
|
||||
#define WS_LCD_DE 5
|
||||
|
||||
// Touch for gt911
|
||||
#define WS_TP_SDA 8
|
||||
#define WS_TP_SCL 9
|
||||
#define WS_TP_RST -1
|
||||
#define WS_TP_INT 4
|
||||
|
||||
//RS485
|
||||
#define WS_RS485_RXD 43
|
||||
#define WS_RS485_TXD 44
|
||||
|
||||
//CAN
|
||||
#define WS_CAN_RXD 15
|
||||
#define WS_CAN_TXD 16
|
||||
|
||||
//Onboard CH422G IO expander
|
||||
#define WS_CH422G_SDA 8
|
||||
#define WS_CH422G_SCL 9
|
||||
|
||||
// UART0 pins
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
// Def for I2C that shares the IMU I2C pins
|
||||
static const uint8_t SDA = 11;
|
||||
static const uint8_t SCL = 10;
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for SPI2
|
||||
static const uint8_t SS = 34; // FSPICS0
|
||||
static const uint8_t MOSI = 35; // FSPID
|
||||
static const uint8_t MISO = 37; // FSPIQ
|
||||
static const uint8_t SCK = 36; // FSPICLK
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for OUTPUT
|
||||
static const uint8_t OUTPUT_IO2 = 2;
|
||||
static const uint8_t OUTPUT_IO3 = 3;
|
||||
static const uint8_t OUTPUT_IO17 = 17;
|
||||
static const uint8_t OUTPUT_IO18 = 18;
|
||||
|
||||
// Analog capable pins on the header
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
|
||||
// GPIO capable pins on the header
|
||||
static const uint8_t D0 = 7;
|
||||
static const uint8_t D1 = 6;
|
||||
static const uint8_t D2 = 5;
|
||||
static const uint8_t D3 = 4;
|
||||
static const uint8_t D4 = 3;
|
||||
static const uint8_t D5 = 2;
|
||||
static const uint8_t D6 = 1;
|
||||
static const uint8_t D7 = 44;
|
||||
static const uint8_t D8 = 43;
|
||||
static const uint8_t D9 = 40;
|
||||
static const uint8_t D10 = 39;
|
||||
static const uint8_t D11 = 38;
|
||||
static const uint8_t D12 = 37;
|
||||
static const uint8_t D13 = 36;
|
||||
static const uint8_t D14 = 35;
|
||||
static const uint8_t D15 = 34;
|
||||
static const uint8_t D16 = 33;
|
||||
|
||||
// Touch input capable pins on the header
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
116
variants/waveshare_esp32_s3_touch_lcd_7/pins_arduino.h
Normal file
116
variants/waveshare_esp32_s3_touch_lcd_7/pins_arduino.h
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
|
||||
#ifndef Pins_Arduino_h
|
||||
#define Pins_Arduino_h
|
||||
|
||||
#include <stdint.h>
|
||||
#include "soc/soc_caps.h"
|
||||
|
||||
// BN: ESP32 Family Device
|
||||
#define USB_VID 0x303a
|
||||
#define USB_PID 0x8234
|
||||
|
||||
#define USB_MANUFACTURER "Waveshare"
|
||||
#define USB_PRODUCT "ESP32-S3-Touch-LCD-7"
|
||||
#define USB_SERIAL ""
|
||||
|
||||
// display for ST7262
|
||||
#define WS_LCD_B3 14
|
||||
#define WS_LCD_B4 38
|
||||
#define WS_LCD_B5 18
|
||||
#define WS_LCD_B6 17
|
||||
#define WS_LCD_B7 10
|
||||
|
||||
#define WS_LCD_G2 39
|
||||
#define WS_LCD_G3 0
|
||||
#define WS_LCD_G4 45
|
||||
#define WS_LCD_G5 48
|
||||
#define WS_LCD_G6 47
|
||||
#define WS_LCD_G7 21
|
||||
|
||||
#define WS_LCD_R3 1
|
||||
#define WS_LCD_R4 2
|
||||
#define WS_LCD_R5 42
|
||||
#define WS_LCD_R6 41
|
||||
#define WS_LCD_R7 40
|
||||
|
||||
#define WS_LCD_VSYNC 3
|
||||
#define WS_LCD_HSYNC 46
|
||||
#define WS_LCD_PCLK 7
|
||||
#define WS_LCD_DE 5
|
||||
|
||||
// Touch for gt911
|
||||
#define WS_TP_SDA 8
|
||||
#define WS_TP_SCL 9
|
||||
#define WS_TP_RST -1
|
||||
#define WS_TP_INT 4
|
||||
|
||||
//RS485
|
||||
#define WS_RS485_RXD 16
|
||||
#define WS_RS485_TXD 15
|
||||
|
||||
//CAN
|
||||
#define WS_CAN_RXD 19
|
||||
#define WS_CAN_TXD 20
|
||||
|
||||
//Onboard CH422G IO expander
|
||||
#define WS_CH422G_SDA 8
|
||||
#define WS_CH422G_SCL 9
|
||||
|
||||
// UART0 pins
|
||||
static const uint8_t TX = 43;
|
||||
static const uint8_t RX = 44;
|
||||
|
||||
// Def for I2C that shares the IMU I2C pins
|
||||
static const uint8_t SDA = 11;
|
||||
static const uint8_t SCL = 10;
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for SPI2
|
||||
static const uint8_t SS = 34; // FSPICS0
|
||||
static const uint8_t MOSI = 35; // FSPID
|
||||
static const uint8_t MISO = 37; // FSPIQ
|
||||
static const uint8_t SCK = 36; // FSPICLK
|
||||
|
||||
// Mapping based on the ESP32S3 data sheet - alternate for OUTPUT
|
||||
static const uint8_t OUTPUT_IO2 = 2;
|
||||
static const uint8_t OUTPUT_IO3 = 3;
|
||||
static const uint8_t OUTPUT_IO17 = 17;
|
||||
static const uint8_t OUTPUT_IO18 = 18;
|
||||
|
||||
// Analog capable pins on the header
|
||||
static const uint8_t A0 = 1;
|
||||
static const uint8_t A1 = 2;
|
||||
static const uint8_t A2 = 3;
|
||||
static const uint8_t A3 = 4;
|
||||
static const uint8_t A4 = 5;
|
||||
static const uint8_t A5 = 6;
|
||||
static const uint8_t A6 = 7;
|
||||
|
||||
// GPIO capable pins on the header
|
||||
static const uint8_t D0 = 7;
|
||||
static const uint8_t D1 = 6;
|
||||
static const uint8_t D2 = 5;
|
||||
static const uint8_t D3 = 4;
|
||||
static const uint8_t D4 = 3;
|
||||
static const uint8_t D5 = 2;
|
||||
static const uint8_t D6 = 1;
|
||||
static const uint8_t D7 = 44;
|
||||
static const uint8_t D8 = 43;
|
||||
static const uint8_t D9 = 40;
|
||||
static const uint8_t D10 = 39;
|
||||
static const uint8_t D11 = 38;
|
||||
static const uint8_t D12 = 37;
|
||||
static const uint8_t D13 = 36;
|
||||
static const uint8_t D14 = 35;
|
||||
static const uint8_t D15 = 34;
|
||||
static const uint8_t D16 = 33;
|
||||
|
||||
// Touch input capable pins on the header
|
||||
static const uint8_t T1 = 1;
|
||||
static const uint8_t T2 = 2;
|
||||
static const uint8_t T3 = 3;
|
||||
static const uint8_t T4 = 4;
|
||||
static const uint8_t T5 = 5;
|
||||
static const uint8_t T6 = 6;
|
||||
static const uint8_t T7 = 7;
|
||||
|
||||
#endif /* Pins_Arduino_h */
|
||||
Loading…
Reference in a new issue