diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3fbed48 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +**/build/ + diff --git a/docs/ABX00083-datasheet.pdf b/docs/ABX00083-datasheet.pdf new file mode 100644 index 0000000..9ca9c97 Binary files /dev/null and b/docs/ABX00083-datasheet.pdf differ diff --git a/docs/ABX00083-schematics.pdf b/docs/ABX00083-schematics.pdf new file mode 100644 index 0000000..26c7ef9 Binary files /dev/null and b/docs/ABX00083-schematics.pdf differ diff --git a/docs/NORA-W10_DataSheet_UBX-21036702.pdf b/docs/NORA-W10_DataSheet_UBX-21036702.pdf new file mode 100644 index 0000000..10729d5 Binary files /dev/null and b/docs/NORA-W10_DataSheet_UBX-21036702.pdf differ diff --git a/docs/Pinout_arduino_nano_esp32.png b/docs/Pinout_arduino_nano_esp32.png new file mode 100644 index 0000000..d27963a Binary files /dev/null and b/docs/Pinout_arduino_nano_esp32.png differ diff --git a/docs/esp32-s3_datasheet_en.pdf b/docs/esp32-s3_datasheet_en.pdf new file mode 100644 index 0000000..eef41f7 Binary files /dev/null and b/docs/esp32-s3_datasheet_en.pdf differ diff --git a/docs/esp32-s3_technical_reference_manual_en.pdf b/docs/esp32-s3_technical_reference_manual_en.pdf new file mode 100644 index 0000000..90cb7c7 Binary files /dev/null and b/docs/esp32-s3_technical_reference_manual_en.pdf differ diff --git a/pinout.jpg b/pinout.jpg new file mode 100644 index 0000000..6e2c5fc Binary files /dev/null and b/pinout.jpg differ diff --git a/pinout.png b/pinout.png new file mode 100644 index 0000000..86c0a87 Binary files /dev/null and b/pinout.png differ diff --git a/pinout.xcf b/pinout.xcf new file mode 100644 index 0000000..a2db357 Binary files /dev/null and b/pinout.xcf differ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..ea1dd0f --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,11 @@ +cmake_minimum_required(VERSION 3.5) + +project(standalone_apps) + +add_subdirectory(pacman) + +add_custom_target( + standalone_apps + DEPENDS pacman_app +) + diff --git a/src/portapack-external-module/.devcontainer/Dockerfile b/src/portapack-external-module/.devcontainer/Dockerfile new file mode 100644 index 0000000..8d7b92d --- /dev/null +++ b/src/portapack-external-module/.devcontainer/Dockerfile @@ -0,0 +1,47 @@ +FROM espressif/idf + +ARG DEBIAN_FRONTEND=nointeractive +ARG CONTAINER_USER=esp +ARG USER_UID=1050 +ARG USER_GID=$USER_UID + +RUN apt-get update \ + && apt install -y -q \ + cmake \ + git \ + libglib2.0-0 \ + libnuma1 \ + libpixman-1-0 \ + && rm -rf /var/lib/apt/lists/* + +# QEMU +ENV QEMU_REL=esp_develop_8.2.0_20240122 +ENV QEMU_SHA256=e7c72ef5705ad1444d391711088c8717fc89f42e9bf6d1487f9c2a326b8cfa83 +ENV QEMU_DIST=qemu-xtensa-softmmu-${QEMU_REL}-x86_64-linux-gnu.tar.xz +ENV QEMU_URL=https://github.com/espressif/qemu/releases/download/esp-develop-8.2.0-20240122/${QEMU_DIST} + +ENV LC_ALL=C.UTF-8 +ENV LANG=C.UTF-8 + +RUN wget --no-verbose ${QEMU_URL} \ + && echo "${QEMU_SHA256} *${QEMU_DIST}" | sha256sum --check --strict - \ + && tar -xf $QEMU_DIST -C /opt \ + && rm ${QEMU_DIST} + +ENV PATH=/opt/qemu/bin:${PATH} + +RUN groupadd --gid $USER_GID $CONTAINER_USER \ + && adduser --uid $USER_UID --gid $USER_GID --disabled-password --gecos "" ${CONTAINER_USER} \ + && usermod -a -G root $CONTAINER_USER && usermod -a -G dialout $CONTAINER_USER + +RUN chmod -R 775 /opt/esp/python_env/ + +USER ${CONTAINER_USER} +ENV USER=${CONTAINER_USER} +WORKDIR /home/${CONTAINER_USER} + +RUN echo "source /opt/esp/idf/export.sh > /dev/null 2>&1" >> ~/.bashrc + +ENTRYPOINT [ "/opt/esp/entrypoint.sh" ] + +CMD ["/bin/bash", "-c"] \ No newline at end of file diff --git a/src/portapack-external-module/.devcontainer/devcontainer.json b/src/portapack-external-module/.devcontainer/devcontainer.json new file mode 100644 index 0000000..09d3b42 --- /dev/null +++ b/src/portapack-external-module/.devcontainer/devcontainer.json @@ -0,0 +1,36 @@ +{ + "name": "ESP-IDF QEMU", + "build": { + "dockerfile": "Dockerfile" + }, + "customizations": { + "vscode": { + "settings": { + "terminal.integrated.defaultProfile.linux": "bash", + "idf.espIdfPath": "/opt/esp/idf", + "idf.customExtraPaths": "", + "idf.pythonBinPath": "/opt/esp/python_env/idf5.4_py3.12_env/bin/python", + "idf.toolsPath": "/opt/esp", + "idf.gitPath": "/usr/bin/git" + }, + "extensions": [ + "espressif.esp-idf-extension" + ] + }, + "codespaces": { + "settings": { + "terminal.integrated.defaultProfile.linux": "bash", + "idf.espIdfPath": "/opt/esp/idf", + "idf.customExtraPaths": "", + "idf.pythonBinPath": "/opt/esp/python_env/idf5.4_py3.12_env/bin/python", + "idf.toolsPath": "/opt/esp", + "idf.gitPath": "/usr/bin/git" + }, + "extensions": [ + "espressif.esp-idf-extension", + "espressif.esp-idf-web" + ] + } + }, + "runArgs": ["--privileged"] +} \ No newline at end of file diff --git a/src/portapack-external-module/CMakeLists.txt b/src/portapack-external-module/CMakeLists.txt new file mode 100644 index 0000000..48245bb --- /dev/null +++ b/src/portapack-external-module/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following lines of boilerplate have to be in your project's CMakeLists +# in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(portapack-external-module) diff --git a/src/portapack-external-module/README.md b/src/portapack-external-module/README.md new file mode 100644 index 0000000..942f225 --- /dev/null +++ b/src/portapack-external-module/README.md @@ -0,0 +1,197 @@ +| Supported Targets | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | + +# I2C Self-Test Example + +(See the README.md file in the upper level 'examples' directory for more information about examples.) + +## Overview + +This example demonstrates basic usage of I2C driver by running two tasks on I2C bus: + +1. Read external I2C sensor, here we take the BH1750 ambient light sensor (GY-30 module) for an example. +2. Use one of the ESP device's I2C port (master mode) to read and write another I2C port (slave mode) in ESP device. + +If you have a new I2C application to go (for example, read the temperature data from external sensor with I2C interface), try this as a basic template, then add your own code. + +## How to use example + +### Hardware Required + +To run this example, you should have one ESP development board (e.g. ESP32-WROVER Kit) or ESP core board (e.g. ESP32-DevKitC). Optionally, you can also connect an external sensor. Here we choose the BH1750 just as an example. BH1750 is a digital ambient light sensor. For more information about it, you can read the [datasheet](http://rohmfs.rohm.com/en/products/databook/datasheet/ic/sensor/light/bh1721fvc-e.pdf) of this sensor. + +#### Pin Assignment(esp32, esp32s2): + +**Note:** The following pin assignments are used by default, you can change these in the `menuconfig` . + +| | SDA | SCL | +| ------------------------- | ------ | ------ | +| ESP32/ESP32-S2 I2C Master | GPIO18 | GPIO19 | +| ESP32/ESP32-S2 I2C Slave | GPIO4 | GPIO5 | +| BH1750 Sensor | SDA | SCL | + +- slave: + - GPIO4 is assigned as the data signal of I2C slave port + - GPIO5 is assigned as the clock signal of I2C slave port +- master: + - GPIO18 is assigned as the data signal of I2C master port + - GPIO19 is assigned as the clock signal of I2C master port + +- Connection: + - connect GPIO18 with GPIO4 + - connect GPIO19 with GPIO5 + - connect SDA/SCL of BH1750 sensor with GPIO18/GPIO19 + +**Note:** It is recommended to add external pull-up resistors for SDA/SCL pins to make the communication more stable, though the driver will enable internal pull-up resistors. + +#### Pin Assignment(esp32s3, esp32h2): + +**Note:** The following pin assignments are used by default, you can change these in the `menuconfig` . + +| | SDA | SCL | +| ---------------------------------- | ------ | ------ | +| ESP32-S3/ESP32-H2 I2C Master | GPIO1 | GPIO2 | +| ESP32-S3/ESP32-H2 I2C Slave | GPIO4 | GPIO5 | +| BH1750 Sensor | SDA | SCL | + +- slave: + - GPIO4 is assigned as the data signal of I2C slave port + - GPIO5 is assigned as the clock signal of I2C slave port +- master: + - GPIO1 is assigned as the data signal of I2C master port + - GPIO2 is assigned as the clock signal of I2C master port + +- Connection: + - connect GPIO1 with GPIO4 + - connect GPIO2 with GPIO5 + - connect SDA/SCL of BH1750 sensor with GPIO18/GPIO19 + +**Note:** It is recommended to add external pull-up resistors for SDA/SCL pins to make the communication more stable, though the driver will enable internal pull-up resistors. + +#### Pin Assignment(esp32c3, esp32c2): + +**Note:** The following pin assignments are used by default, you can change these in the `menuconfig` . + +| | SDA | SCL | +| ------------------------------------------- | ------ | ------ | +| ESP32-C3/ESP32-C2 I2C Master(Slave) | GPIO5 | GPIO6 | +| BH1750 Sensor | SDA | SCL | + +- master: + - GPIO5 is assigned to the data signal of the I2C master port + - GPIO6 is assigned to the clock signal of the I2C master port + +- Connection: + - connect SDA/SCL of BH1750 sensor to GPIO5/GPIO6 + +**Note:** There is only one i2c device on ESP32-C3/ESP32-C2, so it is not possible to perform any ESP32/ESP32-S2 self-test example from this repo. However it is possible to test I2C with external devices. If you find anything wrong with your device, please try connecting external pull-up resistors. + +### Configure the project + +Open the project configuration menu (`idf.py menuconfig`). Then go into `Example Configuration` menu. + +- In the `I2C Master` submenu, you can set the pin number of SDA/SCL according to your board. Also you can modify the I2C port number and freauency of the master. +- In the `I2C Slave` submenu, you can set the pin number of SDA/SCL according to your board. Also you can modify the I2C port number and address of the slave. +- In the `BH1750 Sensor` submenu, you can choose the slave address of BH1750 accroding to the pin level of ADDR pin (if the pin level of ADDR is low then the address is `0x23`, otherwise it is `0x5c`). Here you can also control the operation mode of BH1750, each mode has a different resolution and measurement time. For example, in the `One Time L-Resolution` mode, the resolution is 4 Lux and measurement time is typically 16ms (higher resolution means longer measurement time). For more information, you can consult the datasheet of BH1750. + + +### Build and Flash + +Enter `idf.py -p PORT flash monitor` to build, flash and monitor the project. + +(To exit the serial monitor, type ``Ctrl-]``.) + +See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects. + +## Example Output + +```bash +I (6495) i2c-example: TASK[1] test cnt: 1 +******************* +TASK[1] MASTER READ SENSOR( BH1750 ) +******************* +data_h: 01 +data_l: d0 +sensor val: 386.67 [Lux] +I (6695) i2c-example: TASK[0] test cnt: 2 +******************* +TASK[0] MASTER READ SENSOR( BH1750 ) +******************* +data_h: 01 +data_l: d0 +sensor val: 386.67 [Lux] +******************* +TASK[0] MASTER READ FROM SLAVE +******************* +====TASK[0] Slave buffer data ==== +00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f +10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f +20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f +30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f +40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f +60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f +70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f + +====TASK[0] Master read ==== +00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f +10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f +20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f +30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f +40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f +60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f +70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f + +******************* +TASK[1] MASTER READ FROM SLAVE +******************* +====TASK[1] Slave buffer data ==== +00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f +10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f +20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f +30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f +40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f +60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f +70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f + +====TASK[1] Master read ==== +00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f +10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f +20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f +30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f +40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f +50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f +60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f +70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f + +******************* +TASK[0] MASTER WRITE TO SLAVE +******************* +----TASK[0] Master write ---- +0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 +1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 +2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 +3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 +4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 +5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 +6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 +7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 + +----TASK[0] Slave read: [128] bytes ---- +0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 +1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 +2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 +3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 +4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 +5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 +6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 +7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 +``` + +## Troubleshooting + +- BH1750 has two I2C address, which is decided by the voltage level of `ADDR` pin at start up. Make sure to check your schemetic before run this example. + +(For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you as soon as possible.) diff --git a/src/portapack-external-module/main/CMakeLists.txt b/src/portapack-external-module/main/CMakeLists.txt new file mode 100644 index 0000000..40ded4b --- /dev/null +++ b/src/portapack-external-module/main/CMakeLists.txt @@ -0,0 +1,3 @@ +idf_component_register(SRCS "main.cpp" "i2c_slave_driver.c" + INCLUDE_DIRS "." "../../uart/build" + REQUIRES driver esp_driver_i2c) diff --git a/src/portapack-external-module/main/i2c_slave_driver.c b/src/portapack-external-module/main/i2c_slave_driver.c new file mode 100644 index 0000000..886e021 --- /dev/null +++ b/src/portapack-external-module/main/i2c_slave_driver.c @@ -0,0 +1,364 @@ +/* + Copyright 2024 Unicom Engineering, all rights reserved + + Licensed 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. + + Note to users: this was tested using ESP-IDF version 5.3.1, and the Esp32s2 + chip. It has some calls that are Esp32-S2 specific, because the HAL does not + support certain features that are supported by the hardware. Therefore, you + may have to adjust some calls to get this to work with your device. Either + use HAL functions that support the calls, or rewrite using your device's + registers. Contributions to get this ported to other devices are welcome! + + Much of the setup is copied from the existing slave driver. I'm not sure + exactly what each thing does, but I tried to copy all of the needed calls + from i2c_common.c + + Also, I did not spend a lot of time on configuration, I mostly just + supported our use case. Pull requests to add configuration options are also + welcome! + */ +#include +#include "i2c_slave_driver.h" +#include "esp_attr.h" +#include "esp_intr_types.h" +#include "hal/i2c_hal.h" +#include "driver/gpio.h" +#include "soc/io_mux_reg.h" +#include "esp_private/gpio.h" +#include "esp_private/periph_ctrl.h" +#include "esp_heap_caps.h" +#define LOG_LOCAL_LEVEL ESP_LOG_INFO +#include "esp_log.h" +#include "esp_check.h" + +static const char *TAG = "i2c.unicom_slave"; + +typedef struct +{ + i2c_slave_device_t user_dev; + int portNum; + i2c_slave_callback_fn callback; + intr_handle_t intr; + gpio_num_t scl; + gpio_num_t sda; + i2c_hal_context_t hal; + bool allocated; // is this device used +} i2c_slave_dev_private_t; + +static i2c_slave_dev_private_t i2cdev[2] = {0}; + +static IRAM_ATTR void s_i2c_reset_buffer(i2c_slave_dev_private_t *i2c_slave) +{ + i2c_slave->user_dev.bufstart = 0; + i2c_slave->user_dev.bufend = 0; +} + +static esp_err_t s_hp_i2c_pins_config(i2c_slave_dev_private_t *handle) +{ + int port_id = handle->portNum; + + // SDA pin configurations + gpio_config_t sda_conf = { + .intr_type = GPIO_INTR_DISABLE, + .mode = GPIO_MODE_INPUT_OUTPUT_OD, + .pull_down_en = false, + .pull_up_en = GPIO_PULLUP_ENABLE, + .pin_bit_mask = 1ULL << handle->sda, + }; + ESP_RETURN_ON_ERROR(gpio_set_level(handle->sda, 1), TAG, "i2c sda pin set level failed"); + ESP_RETURN_ON_ERROR(gpio_config(&sda_conf), TAG, "config GPIO failed"); + gpio_func_sel(handle->sda, PIN_FUNC_GPIO); + esp_rom_gpio_connect_out_signal(handle->sda, i2c_periph_signal[port_id].sda_out_sig, 0, 0); + esp_rom_gpio_connect_in_signal(handle->sda, i2c_periph_signal[port_id].sda_in_sig, 0); + + // SCL pin configurations + gpio_config_t scl_conf = { + .intr_type = GPIO_INTR_DISABLE, + .mode = GPIO_MODE_INPUT_OUTPUT_OD, + .pull_down_en = false, + .pull_up_en = GPIO_PULLUP_ENABLE, + .pin_bit_mask = 1ULL << handle->scl, + }; + ESP_RETURN_ON_ERROR(gpio_set_level(handle->scl, 1), TAG, "i2c scl pin set level failed"); + ESP_RETURN_ON_ERROR(gpio_config(&scl_conf), TAG, "config GPIO failed"); + gpio_func_sel(handle->scl, PIN_FUNC_GPIO); + esp_rom_gpio_connect_out_signal(handle->scl, i2c_periph_signal[port_id].scl_out_sig, 0, 0); + esp_rom_gpio_connect_in_signal(handle->scl, i2c_periph_signal[port_id].scl_in_sig, 0); + + return ESP_OK; +} + +static IRAM_ATTR void s_i2c_handle_rx_fifo_wm(i2c_slave_dev_private_t *i2c_slave) +{ + // read all data out of the rx fifo queue. + i2c_hal_context_t *hal = &i2c_slave->hal; + i2c_slave_device_t *s = &i2c_slave->user_dev; + // can't be in send mode here. + uint32_t rx_fifo_cnt; + i2c_ll_get_rxfifo_cnt(hal->dev, &rx_fifo_cnt); + uint32_t fifo_cnt_rd = MIN(sizeof(s->buffer) - s->bufend, rx_fifo_cnt); + if (fifo_cnt_rd > 0) + { + ESP_ERROR_CHECK(s->state == I2C_STATE_SEND ? ESP_ERR_INVALID_STATE : ESP_OK); + i2c_ll_read_rxfifo(hal->dev, s->buffer + s->bufend, fifo_cnt_rd); + s->bufend += fifo_cnt_rd; + s->state = I2C_STATE_RECV; + } + + if (rx_fifo_cnt > fifo_cnt_rd) + { + // throw away additional bytes, we don't have a place to put them + i2c_ll_rxfifo_rst(hal->dev); + } +} + +static IRAM_ATTR void s_i2c_handle_complete(i2c_slave_dev_private_t *i2c_slave) +{ + i2c_hal_context_t *hal = &i2c_slave->hal; + i2c_slave_device_t *s = &i2c_slave->user_dev; + // check if we have received any data. If so, this is an rx complete + if (s->state == I2C_STATE_SEND) + { + // sending, check to see if there were bytes that didn't get sent. + uint32_t tx_fifo_len; + i2c_ll_get_txfifo_len(hal->dev, &tx_fifo_len); + tx_fifo_len = SOC_I2C_FIFO_LEN - tx_fifo_len; + if (tx_fifo_len > 0) + { + s->bufstart -= tx_fifo_len; + // clear the fifo + i2c_ll_txfifo_rst(hal->dev); + } + } + else + { + // read all remaining fifo data + s_i2c_handle_rx_fifo_wm(i2c_slave); + } + if (s->state != I2C_STATE_IDLE) + i2c_slave->callback(s, I2C_CALLBACK_DONE); + + // reset the state of the slave device, it's about to go idle. + i2c_ll_slave_disable_tx_it(hal->dev); + s_i2c_reset_buffer(i2c_slave); + s->state = I2C_STATE_IDLE; +} + +static IRAM_ATTR void s_i2c_handle_tx_fifo_wm(i2c_slave_dev_private_t *i2c_slave) +{ + i2c_hal_context_t *hal = &i2c_slave->hal; + i2c_slave_device_t *s = &i2c_slave->user_dev; + uint32_t tx_fifo_rem; + i2c_ll_get_txfifo_len(hal->dev, &tx_fifo_rem); + uint8_t size = s->bufend - s->bufstart; + if (size > tx_fifo_rem) + { + size = tx_fifo_rem; + } + if (size == 0) + { + // disable the interrupt, there is no data left to send + i2c_ll_slave_disable_tx_it(hal->dev); + } + else + { + ESP_ERROR_CHECK(s->state == I2C_STATE_SEND ? ESP_OK : ESP_ERR_INVALID_STATE); + i2c_ll_write_txfifo(hal->dev, s->buffer + s->bufstart, size); + s->bufstart += size; + i2c_ll_slave_clear_stretch(hal->dev); + if (s->bufstart == s->bufend) // no more data to send + i2c_ll_slave_disable_tx_it(hal->dev); + } +} + +static IRAM_ATTR void s_i2c_handle_clock_stretch(i2c_slave_dev_private_t *i2c_slave) +{ + i2c_hal_context_t *hal = &i2c_slave->hal; + int stretch_cause = hal->dev->sr.stretch_cause; + i2c_slave_device_t *s = &i2c_slave->user_dev; + // esp_rom_printf("stretch cause is %d\n", stretch_cause); + // esp_rom_printf("buffer length is %d\n", hal->dev->status_reg.tx_fifo_cnt); + switch (stretch_cause) + { + case I2C_SLAVE_STRETCH_CAUSE_ADDRESS_MATCH: + // start of a send. Receive any lingering data in the rx buffer, and call the callback. + s_i2c_handle_rx_fifo_wm(i2c_slave); + if (s->state == I2C_STATE_RECV) + { + // transaction in progress, but the master has re-addressed us, let the callback know. + i2c_slave->callback(&i2c_slave->user_dev, I2C_CALLBACK_REPEAT_START); + } + // reset the buffer and fifos for the next transaction + s->state = I2C_STATE_SEND; + s_i2c_reset_buffer(i2c_slave); + // tell the callback that we need some data. + i2c_slave->callback(s, I2C_CALLBACK_SEND_DATA); + // esp_rom_printf("here, receive mode is %d\n", hal->dev->status_reg.slave_rw); + break; + case I2C_SLAVE_STRETCH_CAUSE_RX_FULL: + case I2C_SLAVE_STRETCH_CAUSE_SENDING_ACK: + default: + // clear the condition, we can't do anything at this point + i2c_ll_slave_clear_stretch(hal->dev); + break; + case I2C_SLAVE_STRETCH_CAUSE_TX_EMPTY: + // tell the callback we need more data + i2c_slave->callback(s, I2C_CALLBACK_SEND_DATA); + break; + } +} + +static IRAM_ATTR void s_slave_fifo_isr_handler(uint32_t int_mask, i2c_slave_dev_private_t *i2c_slave) +{ + if (int_mask & I2C_INTR_STRETCH) + { + s_i2c_handle_clock_stretch(i2c_slave); + } + if (int_mask & I2C_INTR_SLV_RXFIFO_WM) + { + s_i2c_handle_rx_fifo_wm(i2c_slave); + } + if (int_mask & I2C_INTR_SLV_COMPLETE) + { + s_i2c_handle_complete(i2c_slave); + } + if (int_mask & I2C_INTR_SLV_TXFIFO_WM) + { + s_i2c_handle_tx_fifo_wm(i2c_slave); + } +} + +static IRAM_ATTR void s_slave_isr_handle_default(void *arg) +{ + i2c_slave_dev_private_t *i2c_slave = (i2c_slave_dev_private_t *)arg; + i2c_hal_context_t *hal = &i2c_slave->hal; + uint32_t int_mask = 0; + + i2c_ll_get_intr_mask(hal->dev, &int_mask); + // esp_rom_printf("int mask: %08lx\n", int_mask); + // esp_rom_printf("rx buffer length is %d\n", hal->dev->status_reg.rx_fifo_cnt); + // esp_rom_printf("slave addressed is %d\n", hal->dev->status_reg.slave_addressed); + // esp_rom_printf("rw is %d\n", hal->dev->status_reg.slave_rw); + if (int_mask == 0) + { + return; + } + + s_slave_fifo_isr_handler(int_mask, i2c_slave); + // clear the interrupts *after* handling. + i2c_ll_clear_intr_mask(hal->dev, int_mask); +} + +esp_err_t i2c_slave_new(i2c_slave_config_t *config, i2c_slave_device_t **result) +{ + // determine the port opened + ESP_RETURN_ON_FALSE(config && result, ESP_ERR_INVALID_ARG, TAG, "invalid argument"); + ESP_RETURN_ON_FALSE(GPIO_IS_VALID_GPIO(config->gpio_sda) && GPIO_IS_VALID_GPIO(config->gpio_scl), ESP_ERR_INVALID_ARG, TAG, "invalid SDA/SCL pin number"); + i2c_slave_dev_private_t *dev = NULL; + for (int i = 0; i < 2; ++i) + { + if (!i2cdev[i].allocated) + { + dev = &i2cdev[i]; + dev->allocated = true; + } + } + // dev = heap_caps_calloc(1, sizeof(i2c_slave_dev_private_t), MALLOC_CAP_DEFAULT); + ESP_RETURN_ON_FALSE(dev, ESP_ERR_INVALID_STATE, TAG, "All slave drivers allocated!"); + dev->callback = config->callback; + dev->scl = config->gpio_scl; + dev->sda = config->gpio_sda; + dev->portNum = config->i2c_port; + dev->user_dev.bufstart = dev->user_dev.bufend = 0; + // initialize the registers + PERIPH_RCC_ATOMIC() + { + i2c_ll_enable_bus_clock(dev->portNum, true); + i2c_ll_reset_register(dev->portNum); + } + + // set up the hal + i2c_hal_context_t *hal = &dev->hal; + i2c_hal_init(hal, dev->portNum); + // enable the GPIO config + ESP_RETURN_ON_ERROR(s_hp_i2c_pins_config(dev), TAG, "Unable to set up pins"); + // set up the interrupt + uint32_t isr_flags = (ESP_INTR_FLAG_SHARED | ESP_INTR_FLAG_LOWMED); + uint32_t isr_mask = (I2C_TRANS_COMPLETE_INT_ENA_M | + I2C_SLAVE_STRETCH_INT_ENA_M | + I2C_RXFIFO_WM_INT_ENA_M | + I2C_TXFIFO_WM_INT_ENA_M); + ESP_RETURN_ON_ERROR(esp_intr_alloc_intrstatus(i2c_periph_signal[dev->portNum].irq, isr_flags, (uint32_t)i2c_ll_get_interrupt_status_reg(hal->dev), isr_mask, s_slave_isr_handle_default, dev, &dev->intr), TAG, "Unable to create interrupt"); + i2c_ll_clear_intr_mask(hal->dev, isr_mask); + i2c_hal_slave_init(hal); + i2c_ll_set_source_clk(hal->dev, 4); + i2c_ll_set_slave_addr(hal->dev, config->address, false); + i2c_ll_set_txfifo_empty_thr(hal->dev, SOC_I2C_FIFO_LEN / 2); + i2c_ll_set_rxfifo_full_thr(hal->dev, SOC_I2C_FIFO_LEN / 2); + i2c_ll_set_sda_timing(hal->dev, 10, 10); + i2c_ll_set_tout(hal->dev, 32000); + + // enable interrupts for stretch and receiveing, those always stay enabled. + i2c_ll_slave_enable_scl_stretch(hal->dev, true); + hal->dev->scl_stretch_conf.stretch_protect_num = 500; + + i2c_ll_slave_tx_auto_start_en(hal->dev, true); + i2c_ll_slave_enable_rx_it(hal->dev); + i2c_ll_enable_intr_mask(hal->dev, I2C_SLAVE_STRETCH_INT_ENA_M); + + i2c_ll_update(hal->dev); + *result = &dev->user_dev; + return ESP_OK; +} + +IRAM_ATTR esp_err_t i2c_slave_send_data(i2c_slave_device_t *dev, uint8_t *buf, uint8_t len) +{ + // write the data to the buffer + ESP_RETURN_ON_FALSE_ISR(dev->state == I2C_STATE_SEND, ESP_ERR_INVALID_STATE, TAG, "Trying to send while not in send state!"); + i2c_slave_dev_private_t *i2c_slave = (i2c_slave_dev_private_t *)dev; + i2c_hal_context_t *hal = &i2c_slave->hal; + len = MIN(len, sizeof(dev->buffer) - dev->bufend); + memcpy(dev->buffer + dev->bufend, buf, len); + dev->bufend += len; + if (len > 0) + { + // enable the tx interrupt so data gets copied into the fifo + i2c_ll_slave_enable_tx_it(hal->dev); + } + return ESP_OK; +} + +IRAM_ATTR esp_err_t i2c_slave_del(i2c_slave_device_t *dev) +{ + i2c_slave_dev_private_t *i2c_slave = (i2c_slave_dev_private_t *)dev; + ESP_RETURN_ON_FALSE(i2c_slave, ESP_ERR_INVALID_ARG, TAG, "invalid slave handle"); + ESP_RETURN_ON_FALSE(i2c_slave->allocated, ESP_ERR_INVALID_ARG, TAG, "Trying to deallocate unallocated slave"); + if (i2c_slave->allocated) + { + i2c_ll_disable_intr_mask(i2c_slave->hal.dev, + I2C_TRANS_COMPLETE_INT_ENA_M | + I2C_SLAVE_STRETCH_INT_ENA_M | + I2C_RXFIFO_WM_INT_ENA_M | + I2C_TXFIFO_WM_INT_ENA_M); + ESP_RETURN_ON_ERROR(esp_intr_free(i2c_slave->intr), TAG, "delete interrupt service failed"); + PERIPH_RCC_ATOMIC() + { + i2c_ll_enable_bus_clock(i2c_slave->portNum, false); + } + i2c_slave_dev_private_t blank = {0}; + *i2c_slave = blank; + // NOTE: pins are not cleared in the normal i2c driver, so we don't do it here. + } + return ESP_OK; +} diff --git a/src/portapack-external-module/main/i2c_slave_driver.h b/src/portapack-external-module/main/i2c_slave_driver.h new file mode 100644 index 0000000..b835b29 --- /dev/null +++ b/src/portapack-external-module/main/i2c_slave_driver.h @@ -0,0 +1,90 @@ +/* + Copyright 2024 Unicom Engineering, all rights reserved + + Licensed 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. + + See the .c file for more notes. + */ +#pragma once + +#if __cplusplus +extern "C" +{ +#endif + +#include +#include +#include "soc/gpio_num.h" +#include "esp_err.h" + + typedef enum I2CSlaveCallbackReason + { + I2C_CALLBACK_REPEAT_START, // The master sent data, and has done a repeat start to read data. + I2C_CALLBACK_SEND_DATA, // The master is asking for us to send data, use i2c_slave_send_data. + I2C_CALLBACK_DONE, // transaction is complete (stop condition seen) + } I2CSlaveCallbackReason; + + struct i2c_slave_device_t; + + // the callback function you should define. The return value is currently + // ignored. + typedef bool (*i2c_slave_callback_fn)(struct i2c_slave_device_t *dev, I2CSlaveCallbackReason reason); + + typedef enum I2CState + { + I2C_STATE_IDLE, // slave is idle, mostly used internally. + I2C_STATE_RECV, // slave has received data from the master + I2C_STATE_SEND // slave is sending data to the master + } I2CState; + + // buffer contains all the data sent or received in the current transaction. + // bufstart denotes the start of the valid data, and bufend denotes the end of + // the valid data. + // + // When sending, data is sent from bufstart, which is incremented, until it + // reaches bufend. The user adds data to the end of the buffer using the + // i2c_slave_send_data + // + // When receiving, data is added to bufend which is incremented, and the user + // can use the bufstart to remember how much has been processed. + typedef struct i2c_slave_device_t + { + uint8_t buffer[128]; + uint8_t bufend; + uint8_t bufstart; + I2CState state; + } i2c_slave_device_t; + + typedef struct i2c_slave_config_t + { + i2c_slave_callback_fn callback; + uint8_t address; // slave address (7 bits) + gpio_num_t gpio_scl; // scl gpio pin to use + gpio_num_t gpio_sda; // sda gpio pin to use + uint8_t i2c_port; // which port to use + } i2c_slave_config_t; + + // create a slave on an i2c port + esp_err_t i2c_slave_new(i2c_slave_config_t *config, i2c_slave_device_t **result); + + // delete a slave on an i2c port. + esp_err_t i2c_slave_del(i2c_slave_device_t *dev); + + // send data to the master. The driver must be in the I2C_STATE_SEND state. + // Data is copied to the internal buffer. Data that does not fit in the buffer + // is ignored. + esp_err_t i2c_slave_send_data(i2c_slave_device_t *dev, uint8_t *buf, uint8_t len); + +#if __cplusplus +} +#endif diff --git a/src/portapack-external-module/main/main.cpp b/src/portapack-external-module/main/main.cpp new file mode 100644 index 0000000..da887db --- /dev/null +++ b/src/portapack-external-module/main/main.cpp @@ -0,0 +1,433 @@ +#include +#include +#include +#include +#include +#include + +#include "driver/i2c.h" +#include "driver/uart.h" +#include "uart_app.h" + +static_assert(sizeof(uart_app) % 32 == 0, "app size must be multiple of 32 bytes. fill with 0s"); + +// NANO:D2 is NORA:J8 is ESP32:9 is GPIO:4 +#define I2C_SLAVE_SDA_IO GPIO_NUM_5 + +// NANO:D3 is NORA:J7 is ESP32:10 is GPIO:5 +#define I2C_SLAVE_SCL_IO GPIO_NUM_6 + +// A7 is GPIO:14 +#define UART_RX GPIO_NUM_14 + +#define ESP_SLAVE_ADDR 0x51 + +#define LED_RED GPIO_NUM_46 +#define LED_GREEN GPIO_NUM_0 +#define LED_BLUE GPIO_NUM_45 + +void initialize_uart(uint32_t baudrate); +void deinitialize_uart(); + +uint32_t baudrate = 115200; + +std::vector baudrates = {50, 75, 110, 134, 150, 200, 300, 600, + 1200, 2400, 4800, 9600, 14400, 19200, + 28800, 38400, 57600, 115200, 230400, + 460800, 576000, 921600, 1843200, 3686400}; + +typedef struct +{ + uint32_t api_version; + uint32_t module_version; + char module_name[20]; + uint32_t application_count; +} device_info; + +enum app_location_t : uint32_t +{ + UTILITIES = 0, + RX, + TX, + DEBUG, + HOME +}; + +typedef struct +{ + uint32_t header_version; + uint8_t app_name[16]; + uint8_t bitmap_data[32]; + uint32_t icon_color; + app_location_t menu_location; + uint32_t binary_size; +} standalone_app_info; + +#define USER_COMMANDS_START 0x7F01 + +enum class Command : uint16_t +{ + COMMAND_NONE = 0, + + // will respond with device_info + COMMAND_INFO = 0x18F0, + + // will respond with info of application + COMMAND_APP_INFO = 0xA90B, + + // will respond with application data + COMMAND_APP_TRANSFER = 0x4183, + + // UART specific commands + COMMAND_UART_REQUESTDATA_SHORT = USER_COMMANDS_START, + COMMAND_UART_REQUESTDATA_LONG, + COMMAND_UART_BAUDRATE_INC, + COMMAND_UART_BAUDRATE_DEC, + COMMAND_UART_BAUDRATE_GET +}; + +volatile Command command_state = Command::COMMAND_NONE; +volatile uint16_t app_counter = 0; +volatile uint16_t app_transfer_block = 0; + +void initialize_gpio() +{ + gpio_install_isr_service(0); + + gpio_set_direction(LED_RED, GPIO_MODE_OUTPUT); + gpio_set_direction(LED_GREEN, GPIO_MODE_OUTPUT); + gpio_set_direction(LED_BLUE, GPIO_MODE_OUTPUT); + + gpio_set_level(LED_RED, 1); + gpio_set_level(LED_GREEN, 1); + gpio_set_level(LED_BLUE, 1); +} + +#include "i2c_slave_driver.h" + +QueueHandle_t slave_queue; +std::queue uart_queue; + +void on_command_ISR(Command command, std::vector additional_data) +{ + command_state = command; + + switch (command) + { + case Command::COMMAND_APP_INFO: + if (additional_data.size() == 2) + app_counter = *(uint16_t *)additional_data.data(); + break; + + case Command::COMMAND_APP_TRANSFER: + if (additional_data.size() == 4) + { + app_counter = *(uint16_t *)additional_data.data(); + app_transfer_block = *(uint16_t *)(additional_data.data() + 2); + } + break; + + case Command::COMMAND_UART_BAUDRATE_INC: + + deinitialize_uart(); + + if (baudrate == baudrates.back()) + baudrate = baudrates.front(); + else + { + auto it = std::find(baudrates.begin(), baudrates.end(), baudrate); + baudrate = *(it + 1); + } + + esp_rom_printf("COMMAND_UART_BAUDRATE_INC: %d\n", baudrate); + + initialize_uart(baudrate); + break; + + case Command::COMMAND_UART_BAUDRATE_DEC: + deinitialize_uart(); + + if (baudrate == baudrates.front()) + baudrate = baudrates.back(); + else + { + auto it = std::find(baudrates.begin(), baudrates.end(), baudrate); + baudrate = *(it - 1); + } + + esp_rom_printf("COMMAND_UART_BAUDRATE_DEC: %d\n", baudrate); + + initialize_uart(baudrate); + break; + + default: + break; + } + + BaseType_t high_task_wakeup = pdFALSE; + xQueueSendFromISR(slave_queue, &command, &high_task_wakeup); +} + +std::vector on_send_ISR() +{ + switch (command_state) + { + case Command::COMMAND_INFO: + { + device_info info = { + /* api_version = */ 1, + /* module_version = */ 1, + /* module_name = */ "ESP32-S3-PPDEVKIT", + /* application_count = */ 1}; + + return std::vector((uint8_t *)&info, (uint8_t *)&info + sizeof(info)); + } + + case Command::COMMAND_APP_INFO: + { + if (app_counter == 0) + { + standalone_app_info app_info; + std::memset(&app_info, 0, sizeof(app_info)); + std::memcpy(&app_info, uart_app, sizeof(app_info) - 4); + app_info.binary_size = sizeof(uart_app); + + app_counter = app_counter + 1; + + return std::vector((uint8_t *)&app_info, (uint8_t *)&app_info + sizeof(app_info)); + } + break; + } + + case Command::COMMAND_APP_TRANSFER: + { + if (app_counter == 0 && app_transfer_block < sizeof(uart_app) / 128) + { + return std::vector(uart_app + app_transfer_block * 128, uart_app + app_transfer_block * 128 + 128); + } + break; + } + + case Command::COMMAND_UART_REQUESTDATA_SHORT: + { + // 1 bit: more data available + // 7 bit: data length [0 to 4] + // 4 bytes: data from uart_queue optionally filled with 0xFF + + const int max_data_length = 4; + std::vector data(1 + max_data_length); + + uint8_t bytesToSend = uart_queue.size() > max_data_length ? max_data_length : uart_queue.size(); + bool moreData = uart_queue.size() > max_data_length ? 1 : 0; + data[0] = (bytesToSend & 0x7F) | (moreData << 7); + + for (int i = bytesToSend; i < max_data_length; i++) + data[i + 1] = 0xFF; + + for (int i = 0; i < bytesToSend; i++) + { + data[i + 1] = uart_queue.front(); + uart_queue.pop(); + } + + return data; + } + + case Command::COMMAND_UART_REQUESTDATA_LONG: + { + // 1 bit: more data available + // 7 bit: data length [0 to 127] + // 127 bytes: data from uart_queue optionally filled with 0xFF + + const int max_data_length = 127; + std::vector data(1 + max_data_length); + + uint8_t bytesToSend = uart_queue.size() > max_data_length ? max_data_length : uart_queue.size(); + bool moreData = uart_queue.size() > max_data_length ? 1 : 0; + data[0] = (bytesToSend & 0x7F) | (moreData << 7); + + for (int i = bytesToSend; i < max_data_length; i++) + data[i + 1] = 0xFF; + + for (int i = 0; i < bytesToSend; i++) + { + data[i + 1] = uart_queue.front(); + uart_queue.pop(); + } + + return data; + } + + case Command::COMMAND_UART_BAUDRATE_GET: + { + std::vector data(4); + esp_rom_printf("COMMAND_UART_BAUDRATE_GET: %d\n", baudrate); + *(uint32_t *)data.data() = baudrate; + return data; + } + break; + + default: + break; + } + + return {0xFF}; +} + +bool i2c_slave_callback_ISR(struct i2c_slave_device_t *dev, I2CSlaveCallbackReason reason) +{ + switch (reason) + { + case I2C_CALLBACK_REPEAT_START: + gpio_set_level(LED_RED, 0); + gpio_set_level(LED_GREEN, 1); + gpio_set_level(LED_BLUE, 1); + + break; + + case I2C_CALLBACK_SEND_DATA: + gpio_set_level(LED_RED, 1); + gpio_set_level(LED_GREEN, 0); + gpio_set_level(LED_BLUE, 1); + + if (dev->state == I2C_STATE_SEND) + { + auto data = on_send_ISR(); + if (data.size() > 0) + i2c_slave_send_data(dev, data.data(), data.size()); + } + + break; + + case I2C_CALLBACK_DONE: + + if (dev->state == I2C_STATE_RECV) + { + gpio_set_level(LED_RED, 1); + gpio_set_level(LED_GREEN, 1); + gpio_set_level(LED_BLUE, 0); + + uint16_t command = *(uint16_t *)&dev->buffer[dev->bufstart]; + std::vector additional_data(dev->buffer + dev->bufstart + 2, dev->buffer + dev->bufend); + + on_command_ISR((Command)command, additional_data); + } + break; + + default: + return false; + } + + return true; +} + +i2c_slave_config_t i2c_slave_config = { + i2c_slave_callback_ISR, + ESP_SLAVE_ADDR, + I2C_SLAVE_SCL_IO, + I2C_SLAVE_SDA_IO, + I2C_NUM_0}; + +i2c_slave_device_t *slave_device; + +void initialize_fixed_i2c() +{ + slave_queue = xQueueCreate(1, sizeof(uint16_t)); + + ESP_ERROR_CHECK(i2c_slave_new(&i2c_slave_config, &slave_device)); +} + +#define BUF_SIZE (1024) + +void initialize_uart(uint32_t baudrate) +{ + uart_config_t uart_config = { + .baud_rate = (int)baudrate, + .data_bits = UART_DATA_8_BITS, + .parity = UART_PARITY_DISABLE, + .stop_bits = UART_STOP_BITS_1, + .flow_ctrl = UART_HW_FLOWCTRL_DISABLE, + .rx_flow_ctrl_thresh = 0, + .source_clk = UART_SCLK_DEFAULT, + .flags = {.backup_before_sleep = 0}}; + + int intr_alloc_flags = 0; + +#if CONFIG_UART_ISR_IN_IRAM + intr_alloc_flags = ESP_INTR_FLAG_IRAM; +#endif + + ESP_ERROR_CHECK(uart_driver_install(UART_NUM_1, BUF_SIZE * 2, 0, 0, NULL, intr_alloc_flags)); + ESP_ERROR_CHECK(uart_param_config(UART_NUM_1, &uart_config)); + ESP_ERROR_CHECK(uart_set_pin(UART_NUM_1, UART_PIN_NO_CHANGE, UART_RX, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE)); +} + +void deinitialize_uart() +{ + ESP_ERROR_CHECK(uart_driver_delete(UART_NUM_1)); +} + +static void i2c_task(void *arg) +{ + while (true) + { + try + { + uint16_t rx_data; + auto success = xQueueReceive(slave_queue, &rx_data, pdMS_TO_TICKS(10000)); + + gpio_set_level(LED_RED, 1); + gpio_set_level(LED_GREEN, 1); + gpio_set_level(LED_BLUE, 1); + + if (success != pdTRUE) + { + continue; + } + + // std::cout << "-- Received: 0x" << std::hex << rx_data << std::endl; + } + catch (const std::exception &ex) + { + std::cout << "Exception: " << std::endl; + std::cout << ex.what() << std::endl; + } + } +} + +static void uart_task(void *arg) +{ + uint8_t *data = (uint8_t *)malloc(BUF_SIZE); + while (true) + { + try + { + int len = uart_read_bytes(UART_NUM_1, data, (BUF_SIZE - 1), 20 / portTICK_PERIOD_MS); + if (len != 0) + { + // std::cout << "uart len: " << len << std::endl; + // std::cout << "uart data: " << std::string((char *)data, len) << std::endl; + + for (int i = 0; i < len; i++) + uart_queue.push(data[i]); + } + } + catch (const std::exception &ex) + { + std::cout << "Exception: " << std::endl; + std::cout << ex.what() << std::endl; + } + } +} + +extern "C" void app_main(void) +{ + initialize_gpio(); + initialize_fixed_i2c(); + initialize_uart(baudrate); + + xTaskCreate(i2c_task, "i2c_task", 1024 * 2, (void *)0, 10, NULL); + xTaskCreate(uart_task, "uart_task", 1024 * 2, (void *)0, 10, NULL); + + std::cout << "[PP MDK] PortaPack - Module Develoment Kit is ready." << std::endl; +} diff --git a/src/portapack-external-module/sdkconfig b/src/portapack-external-module/sdkconfig new file mode 100644 index 0000000..02529df --- /dev/null +++ b/src/portapack-external-module/sdkconfig @@ -0,0 +1,2219 @@ +# +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) 5.3.1 Project Configuration +# +CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 +CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 +CONFIG_SOC_ADC_SUPPORTED=y +CONFIG_SOC_UART_SUPPORTED=y +CONFIG_SOC_PCNT_SUPPORTED=y +CONFIG_SOC_PHY_SUPPORTED=y +CONFIG_SOC_WIFI_SUPPORTED=y +CONFIG_SOC_TWAI_SUPPORTED=y +CONFIG_SOC_GDMA_SUPPORTED=y +CONFIG_SOC_AHB_GDMA_SUPPORTED=y +CONFIG_SOC_GPTIMER_SUPPORTED=y +CONFIG_SOC_LCDCAM_SUPPORTED=y +CONFIG_SOC_MCPWM_SUPPORTED=y +CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y +CONFIG_SOC_CACHE_SUPPORT_WRAP=y +CONFIG_SOC_ULP_SUPPORTED=y +CONFIG_SOC_ULP_FSM_SUPPORTED=y +CONFIG_SOC_RISCV_COPROC_SUPPORTED=y +CONFIG_SOC_BT_SUPPORTED=y +CONFIG_SOC_USB_OTG_SUPPORTED=y +CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y +CONFIG_SOC_CCOMP_TIMER_SUPPORTED=y +CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED=y +CONFIG_SOC_SUPPORTS_SECURE_DL_MODE=y +CONFIG_SOC_EFUSE_KEY_PURPOSE_FIELD=y +CONFIG_SOC_EFUSE_SUPPORTED=y +CONFIG_SOC_SDMMC_HOST_SUPPORTED=y +CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_MEM_SUPPORTED=y +CONFIG_SOC_RTC_MEM_SUPPORTED=y +CONFIG_SOC_PSRAM_DMA_CAPABLE=y +CONFIG_SOC_XT_WDT_SUPPORTED=y +CONFIG_SOC_I2S_SUPPORTED=y +CONFIG_SOC_RMT_SUPPORTED=y +CONFIG_SOC_SDM_SUPPORTED=y +CONFIG_SOC_GPSPI_SUPPORTED=y +CONFIG_SOC_LEDC_SUPPORTED=y +CONFIG_SOC_I2C_SUPPORTED=y +CONFIG_SOC_SYSTIMER_SUPPORTED=y +CONFIG_SOC_SUPPORT_COEXISTENCE=y +CONFIG_SOC_TEMP_SENSOR_SUPPORTED=y +CONFIG_SOC_AES_SUPPORTED=y +CONFIG_SOC_MPI_SUPPORTED=y +CONFIG_SOC_SHA_SUPPORTED=y +CONFIG_SOC_HMAC_SUPPORTED=y +CONFIG_SOC_DIG_SIGN_SUPPORTED=y +CONFIG_SOC_FLASH_ENC_SUPPORTED=y +CONFIG_SOC_SECURE_BOOT_SUPPORTED=y +CONFIG_SOC_MEMPROT_SUPPORTED=y +CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y +CONFIG_SOC_BOD_SUPPORTED=y +CONFIG_SOC_CLK_TREE_SUPPORTED=y +CONFIG_SOC_MPU_SUPPORTED=y +CONFIG_SOC_WDT_SUPPORTED=y +CONFIG_SOC_SPI_FLASH_SUPPORTED=y +CONFIG_SOC_RNG_SUPPORTED=y +CONFIG_SOC_LIGHT_SLEEP_SUPPORTED=y +CONFIG_SOC_DEEP_SLEEP_SUPPORTED=y +CONFIG_SOC_LP_PERIPH_SHARE_INTERRUPT=y +CONFIG_SOC_PM_SUPPORTED=y +CONFIG_SOC_XTAL_SUPPORT_40M=y +CONFIG_SOC_APPCPU_HAS_CLOCK_GATING_BUG=y +CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_ARBITER_SUPPORTED=y +CONFIG_SOC_ADC_DIG_IIR_FILTER_SUPPORTED=y +CONFIG_SOC_ADC_MONITOR_SUPPORTED=y +CONFIG_SOC_ADC_DMA_SUPPORTED=y +CONFIG_SOC_ADC_PERIPH_NUM=2 +CONFIG_SOC_ADC_MAX_CHANNEL_NUM=10 +CONFIG_SOC_ADC_ATTEN_NUM=4 +CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2 +CONFIG_SOC_ADC_PATT_LEN_MAX=24 +CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=12 +CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_DIGI_RESULT_BYTES=4 +CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4 +CONFIG_SOC_ADC_DIGI_IIR_FILTER_NUM=2 +CONFIG_SOC_ADC_DIGI_MONITOR_NUM=2 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=83333 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=611 +CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=12 +CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_CALIBRATION_V1_SUPPORTED=y +CONFIG_SOC_ADC_SELF_HW_CALI_SUPPORTED=y +CONFIG_SOC_ADC_SHARED_POWER=y +CONFIG_SOC_APB_BACKUP_DMA=y +CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y +CONFIG_SOC_CACHE_WRITEBACK_SUPPORTED=y +CONFIG_SOC_CACHE_FREEZE_SUPPORTED=y +CONFIG_SOC_CPU_CORES_NUM=2 +CONFIG_SOC_CPU_INTR_NUM=32 +CONFIG_SOC_CPU_HAS_FPU=y +CONFIG_SOC_HP_CPU_HAS_MULTIPLE_CORES=y +CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINT_MAX_REGION_SIZE=64 +CONFIG_SOC_DS_SIGNATURE_MAX_BIT_LEN=4096 +CONFIG_SOC_DS_KEY_PARAM_MD_IV_LENGTH=16 +CONFIG_SOC_DS_KEY_CHECK_MAX_WAIT_US=1100 +CONFIG_SOC_AHB_GDMA_VERSION=1 +CONFIG_SOC_GDMA_NUM_GROUPS_MAX=1 +CONFIG_SOC_GDMA_PAIRS_PER_GROUP=5 +CONFIG_SOC_GDMA_PAIRS_PER_GROUP_MAX=5 +CONFIG_SOC_AHB_GDMA_SUPPORT_PSRAM=y +CONFIG_SOC_GPIO_PORT=1 +CONFIG_SOC_GPIO_PIN_COUNT=49 +CONFIG_SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER=y +CONFIG_SOC_GPIO_FILTER_CLK_SUPPORT_APB=y +CONFIG_SOC_GPIO_SUPPORT_RTC_INDEPENDENT=y +CONFIG_SOC_GPIO_SUPPORT_FORCE_HOLD=y +CONFIG_SOC_GPIO_VALID_GPIO_MASK=0x1FFFFFFFFFFFF +CONFIG_SOC_GPIO_IN_RANGE_MAX=48 +CONFIG_SOC_GPIO_OUT_RANGE_MAX=48 +CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x0001FFFFFC000000 +CONFIG_SOC_GPIO_CLOCKOUT_BY_IO_MUX=y +CONFIG_SOC_GPIO_CLOCKOUT_CHANNEL_NUM=3 +CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8 +CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8 +CONFIG_SOC_DEDIC_GPIO_OUT_AUTO_ENABLE=y +CONFIG_SOC_I2C_NUM=2 +CONFIG_SOC_HP_I2C_NUM=2 +CONFIG_SOC_I2C_FIFO_LEN=32 +CONFIG_SOC_I2C_CMD_REG_NUM=8 +CONFIG_SOC_I2C_SUPPORT_SLAVE=y +CONFIG_SOC_I2C_SUPPORT_HW_CLR_BUS=y +CONFIG_SOC_I2C_SUPPORT_XTAL=y +CONFIG_SOC_I2C_SUPPORT_RTC=y +CONFIG_SOC_I2C_SUPPORT_10BIT_ADDR=y +CONFIG_SOC_I2C_SLAVE_SUPPORT_BROADCAST=y +CONFIG_SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS=y +CONFIG_SOC_I2S_NUM=2 +CONFIG_SOC_I2S_HW_VERSION_2=y +CONFIG_SOC_I2S_SUPPORTS_XTAL=y +CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y +CONFIG_SOC_I2S_SUPPORTS_PCM=y +CONFIG_SOC_I2S_SUPPORTS_PDM=y +CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y +CONFIG_SOC_I2S_PDM_MAX_TX_LINES=2 +CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y +CONFIG_SOC_I2S_PDM_MAX_RX_LINES=4 +CONFIG_SOC_I2S_SUPPORTS_TDM=y +CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y +CONFIG_SOC_LEDC_SUPPORT_XTAL_CLOCK=y +CONFIG_SOC_LEDC_CHANNEL_NUM=8 +CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=14 +CONFIG_SOC_LEDC_SUPPORT_FADE_STOP=y +CONFIG_SOC_MCPWM_GROUPS=2 +CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3 +CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3 +CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3 +CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y +CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3 +CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 +CONFIG_SOC_MCPWM_SWSYNC_CAN_PROPAGATE=y +CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=1 +CONFIG_SOC_MMU_PERIPH_NUM=1 +CONFIG_SOC_PCNT_GROUPS=1 +CONFIG_SOC_PCNT_UNITS_PER_GROUP=4 +CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 +CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2 +CONFIG_SOC_RMT_GROUPS=1 +CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=4 +CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=4 +CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 +CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=48 +CONFIG_SOC_RMT_SUPPORT_RX_PINGPONG=y +CONFIG_SOC_RMT_SUPPORT_RX_DEMODULATION=y +CONFIG_SOC_RMT_SUPPORT_TX_ASYNC_STOP=y +CONFIG_SOC_RMT_SUPPORT_TX_LOOP_COUNT=y +CONFIG_SOC_RMT_SUPPORT_TX_LOOP_AUTO_STOP=y +CONFIG_SOC_RMT_SUPPORT_TX_SYNCHRO=y +CONFIG_SOC_RMT_SUPPORT_TX_CARRIER_DATA_ONLY=y +CONFIG_SOC_RMT_SUPPORT_XTAL=y +CONFIG_SOC_RMT_SUPPORT_RC_FAST=y +CONFIG_SOC_RMT_SUPPORT_APB=y +CONFIG_SOC_RMT_SUPPORT_DMA=y +CONFIG_SOC_LCD_I80_SUPPORTED=y +CONFIG_SOC_LCD_RGB_SUPPORTED=y +CONFIG_SOC_LCD_I80_BUSES=1 +CONFIG_SOC_LCD_RGB_PANELS=1 +CONFIG_SOC_LCD_I80_BUS_WIDTH=16 +CONFIG_SOC_LCD_RGB_DATA_WIDTH=16 +CONFIG_SOC_LCD_SUPPORT_RGB_YUV_CONV=y +CONFIG_SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH=128 +CONFIG_SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM=549 +CONFIG_SOC_RTC_CNTL_TAGMEM_PD_DMA_BUS_WIDTH=128 +CONFIG_SOC_RTCIO_PIN_COUNT=22 +CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y +CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y +CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y +CONFIG_SOC_SDM_GROUPS=y +CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8 +CONFIG_SOC_SDM_CLK_SUPPORT_APB=y +CONFIG_SOC_SPI_PERIPH_NUM=3 +CONFIG_SOC_SPI_MAX_CS_NUM=6 +CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 +CONFIG_SOC_SPI_SUPPORT_DDRCLK=y +CONFIG_SOC_SPI_SLAVE_SUPPORT_SEG_TRANS=y +CONFIG_SOC_SPI_SUPPORT_CD_SIG=y +CONFIG_SOC_SPI_SUPPORT_CONTINUOUS_TRANS=y +CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2=y +CONFIG_SOC_SPI_SUPPORT_CLK_APB=y +CONFIG_SOC_SPI_SUPPORT_CLK_XTAL=y +CONFIG_SOC_SPI_PERIPH_SUPPORT_CONTROL_DUMMY_OUT=y +CONFIG_SOC_MEMSPI_IS_INDEPENDENT=y +CONFIG_SOC_SPI_MAX_PRE_DIVIDER=16 +CONFIG_SOC_SPI_SUPPORT_OCT=y +CONFIG_SOC_SPI_SCT_SUPPORTED=y +CONFIG_SOC_SPI_SCT_REG_NUM=14 +CONFIG_SOC_SPI_SCT_BUFFER_NUM_MAX=y +CONFIG_SOC_SPI_SCT_CONF_BITLEN_MAX=0x3FFFA +CONFIG_SOC_MEMSPI_SRC_FREQ_120M=y +CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y +CONFIG_SOC_SPIRAM_SUPPORTED=y +CONFIG_SOC_SPIRAM_XIP_SUPPORTED=y +CONFIG_SOC_SYSTIMER_COUNTER_NUM=2 +CONFIG_SOC_SYSTIMER_ALARM_NUM=3 +CONFIG_SOC_SYSTIMER_BIT_WIDTH_LO=32 +CONFIG_SOC_SYSTIMER_BIT_WIDTH_HI=20 +CONFIG_SOC_SYSTIMER_FIXED_DIVIDER=y +CONFIG_SOC_SYSTIMER_INT_LEVEL=y +CONFIG_SOC_SYSTIMER_ALARM_MISS_COMPENSATE=y +CONFIG_SOC_TIMER_GROUPS=2 +CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2 +CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=54 +CONFIG_SOC_TIMER_GROUP_SUPPORT_XTAL=y +CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y +CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4 +CONFIG_SOC_TOUCH_SENSOR_VERSION=2 +CONFIG_SOC_TOUCH_SENSOR_NUM=15 +CONFIG_SOC_TOUCH_SUPPORT_SLEEP_WAKEUP=y +CONFIG_SOC_TOUCH_SUPPORT_WATERPROOF=y +CONFIG_SOC_TOUCH_SUPPORT_PROX_SENSING=y +CONFIG_SOC_TOUCH_PROXIMITY_CHANNEL_NUM=3 +CONFIG_SOC_TOUCH_PROXIMITY_MEAS_DONE_SUPPORTED=y +CONFIG_SOC_TOUCH_SAMPLE_CFG_NUM=1 +CONFIG_SOC_TWAI_CONTROLLER_NUM=1 +CONFIG_SOC_TWAI_CLK_SUPPORT_APB=y +CONFIG_SOC_TWAI_BRP_MIN=2 +CONFIG_SOC_TWAI_BRP_MAX=16384 +CONFIG_SOC_TWAI_SUPPORTS_RX_STATUS=y +CONFIG_SOC_UART_NUM=3 +CONFIG_SOC_UART_HP_NUM=3 +CONFIG_SOC_UART_FIFO_LEN=128 +CONFIG_SOC_UART_BITRATE_MAX=5000000 +CONFIG_SOC_UART_SUPPORT_FSM_TX_WAIT_SEND=y +CONFIG_SOC_UART_SUPPORT_WAKEUP_INT=y +CONFIG_SOC_UART_SUPPORT_APB_CLK=y +CONFIG_SOC_UART_SUPPORT_RTC_CLK=y +CONFIG_SOC_UART_SUPPORT_XTAL_CLK=y +CONFIG_SOC_USB_OTG_PERIPH_NUM=1 +CONFIG_SOC_SHA_DMA_MAX_BUFFER_SIZE=3968 +CONFIG_SOC_SHA_SUPPORT_DMA=y +CONFIG_SOC_SHA_SUPPORT_RESUME=y +CONFIG_SOC_SHA_GDMA=y +CONFIG_SOC_SHA_SUPPORT_SHA1=y +CONFIG_SOC_SHA_SUPPORT_SHA224=y +CONFIG_SOC_SHA_SUPPORT_SHA256=y +CONFIG_SOC_SHA_SUPPORT_SHA384=y +CONFIG_SOC_SHA_SUPPORT_SHA512=y +CONFIG_SOC_SHA_SUPPORT_SHA512_224=y +CONFIG_SOC_SHA_SUPPORT_SHA512_256=y +CONFIG_SOC_SHA_SUPPORT_SHA512_T=y +CONFIG_SOC_MPI_MEM_BLOCKS_NUM=4 +CONFIG_SOC_MPI_OPERATIONS_NUM=3 +CONFIG_SOC_RSA_MAX_BIT_LEN=4096 +CONFIG_SOC_AES_SUPPORT_DMA=y +CONFIG_SOC_AES_GDMA=y +CONFIG_SOC_AES_SUPPORT_AES_128=y +CONFIG_SOC_AES_SUPPORT_AES_256=y +CONFIG_SOC_PM_SUPPORT_EXT0_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_WIFI_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_BT_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_CPU_PD=y +CONFIG_SOC_PM_SUPPORT_TAGMEM_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y +CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y +CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y +CONFIG_SOC_PM_SUPPORT_MAC_BB_PD=y +CONFIG_SOC_PM_SUPPORT_MODEM_PD=y +CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y +CONFIG_SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY=y +CONFIG_SOC_PM_CPU_RETENTION_BY_RTCCNTL=y +CONFIG_SOC_PM_MODEM_RETENTION_BY_BACKUPDMA=y +CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y +CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y +CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y +CONFIG_SOC_EFUSE_DIS_DOWNLOAD_ICACHE=y +CONFIG_SOC_EFUSE_DIS_DOWNLOAD_DCACHE=y +CONFIG_SOC_EFUSE_HARD_DIS_JTAG=y +CONFIG_SOC_EFUSE_DIS_USB_JTAG=y +CONFIG_SOC_EFUSE_SOFT_DIS_JTAG=y +CONFIG_SOC_EFUSE_DIS_DIRECT_BOOT=y +CONFIG_SOC_EFUSE_DIS_ICACHE=y +CONFIG_SOC_EFUSE_BLOCK9_KEY_PURPOSE_QUIRK=y +CONFIG_SOC_SECURE_BOOT_V2_RSA=y +CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=3 +CONFIG_SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS=y +CONFIG_SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY=y +CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=64 +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES=y +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_OPTIONS=y +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_128=y +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_256=y +CONFIG_SOC_MEMPROT_CPU_PREFETCH_PAD_SIZE=16 +CONFIG_SOC_MEMPROT_MEM_ALIGN_SIZE=256 +CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 +CONFIG_SOC_MAC_BB_PD_MEM_SIZE=192 +CONFIG_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH=12 +CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_WAIT_IDLE=y +CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_SUSPEND=y +CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_RESUME=y +CONFIG_SOC_SPI_MEM_SUPPORT_SW_SUSPEND=y +CONFIG_SOC_SPI_MEM_SUPPORT_OPI_MODE=y +CONFIG_SOC_SPI_MEM_SUPPORT_TIMING_TUNING=y +CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y +CONFIG_SOC_SPI_MEM_SUPPORT_WRAP=y +CONFIG_SOC_MEMSPI_TIMING_TUNING_BY_MSPI_DELAY=y +CONFIG_SOC_MEMSPI_CORE_CLK_SHARED_WITH_PSRAM=y +CONFIG_SOC_COEX_HW_PTI=y +CONFIG_SOC_EXTERNAL_COEX_LEADER_TX_LINE=y +CONFIG_SOC_SDMMC_USE_GPIO_MATRIX=y +CONFIG_SOC_SDMMC_NUM_SLOTS=2 +CONFIG_SOC_SDMMC_SUPPORT_XTAL_CLOCK=y +CONFIG_SOC_SDMMC_DELAY_PHASE_NUM=4 +CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC=y +CONFIG_SOC_WIFI_HW_TSF=y +CONFIG_SOC_WIFI_FTM_SUPPORT=y +CONFIG_SOC_WIFI_GCMP_SUPPORT=y +CONFIG_SOC_WIFI_WAPI_SUPPORT=y +CONFIG_SOC_WIFI_CSI_SUPPORT=y +CONFIG_SOC_WIFI_MESH_SUPPORT=y +CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y +CONFIG_SOC_WIFI_PHY_NEEDS_USB_WORKAROUND=y +CONFIG_SOC_BLE_SUPPORTED=y +CONFIG_SOC_BLE_MESH_SUPPORTED=y +CONFIG_SOC_BLE_50_SUPPORTED=y +CONFIG_SOC_BLE_DEVICE_PRIVACY_SUPPORTED=y +CONFIG_SOC_BLUFI_SUPPORTED=y +CONFIG_SOC_ULP_HAS_ADC=y +CONFIG_SOC_PHY_COMBO_MODULE=y +CONFIG_IDF_CMAKE=y +CONFIG_IDF_TOOLCHAIN="gcc" +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET_ARCH="xtensa" +CONFIG_IDF_TARGET="esp32s3" +CONFIG_IDF_INIT_VERSION="5.3.1" +CONFIG_IDF_TARGET_ESP32S3=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 + +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +# CONFIG_APP_REPRODUCIBLE_BUILD is not set +# CONFIG_APP_NO_BLOBS is not set +# end of Build type + +# +# Bootloader config +# + +# +# Bootloader manager +# +CONFIG_BOOTLOADER_COMPILE_TIME_DATE=y +CONFIG_BOOTLOADER_PROJECT_VER=1 +# end of Bootloader manager + +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=3 + +# +# Serial Flash Configurations +# +# CONFIG_BOOTLOADER_FLASH_DC_AWARE is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Serial Flash Configurations + +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y +CONFIG_BOOTLOADER_WDT_ENABLE=y +# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set +CONFIG_BOOTLOADER_WDT_TIME_MS=9000 +# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +# end of Bootloader config + +# +# Security features +# +CONFIG_SECURE_BOOT_V2_RSA_SUPPORTED=y +CONFIG_SECURE_BOOT_V2_PREFERRED=y +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +CONFIG_SECURE_ROM_DL_MODE_ENABLED=y +# end of Security features + +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 +# end of Application manager + +CONFIG_ESP_ROM_HAS_CRC_LE=y +CONFIG_ESP_ROM_HAS_CRC_BE=y +CONFIG_ESP_ROM_HAS_MZ_CRC32=y +CONFIG_ESP_ROM_HAS_JPEG_DECODE=y +CONFIG_ESP_ROM_UART_CLK_IS_XTAL=y +CONFIG_ESP_ROM_HAS_RETARGETABLE_LOCKING=y +CONFIG_ESP_ROM_USB_OTG_NUM=3 +CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=4 +CONFIG_ESP_ROM_HAS_ERASE_0_REGION_BUG=y +CONFIG_ESP_ROM_HAS_ENCRYPTED_WRITES_USING_LEGACY_DRV=y +CONFIG_ESP_ROM_GET_CLK_FREQ=y +CONFIG_ESP_ROM_HAS_HAL_WDT=y +CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y +CONFIG_ESP_ROM_HAS_LAYOUT_TABLE=y +CONFIG_ESP_ROM_HAS_SPI_FLASH=y +CONFIG_ESP_ROM_HAS_ETS_PRINTF_BUG=y +CONFIG_ESP_ROM_HAS_NEWLIB=y +CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y +CONFIG_ESP_ROM_HAS_NEWLIB_32BIT_TIME=y +CONFIG_ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE=y +CONFIG_ESP_ROM_RAM_APP_NEEDS_MMU_INIT=y +CONFIG_ESP_ROM_HAS_FLASH_COUNT_PAGES_BUG=y +CONFIG_ESP_ROM_HAS_CACHE_SUSPEND_WAITI_BUG=y +CONFIG_ESP_ROM_HAS_CACHE_WRITEBACK_BUG=y +CONFIG_ESP_ROM_HAS_SW_FLOAT=y +CONFIG_ESP_ROM_HAS_VERSION=y +CONFIG_ESP_ROM_SUPPORT_DEEP_SLEEP_WAKEUP_STUB=y + +# +# Boot ROM Behavior +# +CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y +# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set +# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set +# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set +# end of Boot ROM Behavior + +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_OCT_FLASH is not set +CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=y +# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +CONFIG_ESPTOOLPY_FLASHMODE_DIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT=y +CONFIG_ESPTOOLPY_FLASHFREQ="80m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="16MB" +# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Partition Table +# +CONFIG_PARTITION_TABLE_SINGLE_APP=y +# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set +# CONFIG_PARTITION_TABLE_TWO_OTA is not set +# CONFIG_PARTITION_TABLE_CUSTOM is not set +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table + +# +# Compiler options +# +CONFIG_COMPILER_OPTIMIZATION_DEBUG=y +# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set +# CONFIG_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set +CONFIG_COMPILER_HIDE_PATHS_MACROS=y +CONFIG_COMPILER_CXX_EXCEPTIONS=y +CONFIG_COMPILER_CXX_EXCEPTIONS_EMG_POOL_SIZE=0 +CONFIG_COMPILER_CXX_RTTI=y +CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y +# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set +# CONFIG_COMPILER_DISABLE_GCC13_WARNINGS is not set +# CONFIG_COMPILER_DUMP_RTL_FILES is not set +CONFIG_COMPILER_RT_LIB_GCCLIB=y +CONFIG_COMPILER_RT_LIB_NAME="gcc" +# CONFIG_COMPILER_ORPHAN_SECTIONS_WARNING is not set +CONFIG_COMPILER_ORPHAN_SECTIONS_PLACE=y +# end of Compiler options + +# +# Component config +# + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_JTAG is not set +CONFIG_APPTRACE_DEST_NONE=y +# CONFIG_APPTRACE_DEST_UART1 is not set +# CONFIG_APPTRACE_DEST_UART2 is not set +# CONFIG_APPTRACE_DEST_USB_CDC is not set +CONFIG_APPTRACE_DEST_UART_NONE=y +CONFIG_APPTRACE_UART_TASK_PRIO=1 +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Bluetooth +# +# CONFIG_BT_ENABLED is not set +CONFIG_BT_ALARM_MAX_NUM=50 +# end of Bluetooth + +# +# Console Library +# +# CONFIG_CONSOLE_SORTED_HELP is not set +# end of Console Library + +# +# Driver Configurations +# + +# +# TWAI Configuration +# +# CONFIG_TWAI_ISR_IN_IRAM is not set +CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y +# end of TWAI Configuration + +# +# Legacy ADC Driver Configuration +# +# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set + +# +# Legacy ADC Calibration Configuration +# +# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy ADC Calibration Configuration +# end of Legacy ADC Driver Configuration + +# +# Legacy MCPWM Driver Configurations +# +# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy MCPWM Driver Configurations + +# +# Legacy Timer Group Driver Configurations +# +# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy Timer Group Driver Configurations + +# +# Legacy RMT Driver Configurations +# +# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy RMT Driver Configurations + +# +# Legacy I2S Driver Configurations +# +# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy I2S Driver Configurations + +# +# Legacy PCNT Driver Configurations +# +# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy PCNT Driver Configurations + +# +# Legacy SDM Driver Configurations +# +# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy SDM Driver Configurations + +# +# Legacy Temperature Sensor Driver Configurations +# +# CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy Temperature Sensor Driver Configurations +# end of Driver Configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +CONFIG_EFUSE_MAX_BLK_LEN=256 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER_CERT_SELECT_HOOK is not set +# CONFIG_ESP_TLS_SERVER_MIN_AUTH_MODE_OPTIONAL is not set +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# CONFIG_ESP_TLS_INSECURE is not set +# end of ESP-TLS + +# +# ADC and ADC Calibration +# +# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set +# CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set +# CONFIG_ADC_ENABLE_DEBUG_LOG is not set +# end of ADC and ADC Calibration + +# +# Wireless Coexistence +# +CONFIG_ESP_COEX_ENABLED=y +# CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE is not set +# end of Wireless Coexistence + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# ESP-Driver:GPIO Configurations +# +# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set +# end of ESP-Driver:GPIO Configurations + +# +# ESP-Driver:GPTimer Configurations +# +CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y +# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set +# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set +# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:GPTimer Configurations + +# +# ESP-Driver:I2C Configurations +# +# CONFIG_I2C_ISR_IRAM_SAFE is not set +# CONFIG_I2C_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:I2C Configurations + +# +# ESP-Driver:I2S Configurations +# +# CONFIG_I2S_ISR_IRAM_SAFE is not set +# CONFIG_I2S_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:I2S Configurations + +# +# ESP-Driver:LEDC Configurations +# +# CONFIG_LEDC_CTRL_FUNC_IN_IRAM is not set +# end of ESP-Driver:LEDC Configurations + +# +# ESP-Driver:MCPWM Configurations +# +# CONFIG_MCPWM_ISR_IRAM_SAFE is not set +# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:MCPWM Configurations + +# +# ESP-Driver:PCNT Configurations +# +# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_PCNT_ISR_IRAM_SAFE is not set +# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:PCNT Configurations + +# +# ESP-Driver:RMT Configurations +# +# CONFIG_RMT_ISR_IRAM_SAFE is not set +# CONFIG_RMT_RECV_FUNC_IN_IRAM is not set +# CONFIG_RMT_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:RMT Configurations + +# +# ESP-Driver:Sigma Delta Modulator Configurations +# +# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_SDM_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:Sigma Delta Modulator Configurations + +# +# ESP-Driver:SPI Configurations +# +# CONFIG_SPI_MASTER_IN_IRAM is not set +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_IN_IRAM is not set +CONFIG_SPI_SLAVE_ISR_IN_IRAM=y +# end of ESP-Driver:SPI Configurations + +# +# ESP-Driver:Touch Sensor Configurations +# +# CONFIG_TOUCH_CTRL_FUNC_IN_IRAM is not set +# CONFIG_TOUCH_ISR_IRAM_SAFE is not set +# CONFIG_TOUCH_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:Touch Sensor Configurations + +# +# ESP-Driver:Temperature Sensor Configurations +# +# CONFIG_TEMP_SENSOR_ENABLE_DEBUG_LOG is not set +# end of ESP-Driver:Temperature Sensor Configurations + +# +# ESP-Driver:UART Configurations +# +# CONFIG_UART_ISR_IN_IRAM is not set +# end of ESP-Driver:UART Configurations + +# +# ESP-Driver:USB Serial/JTAG Configuration +# +CONFIG_USJ_ENABLE_USB_SERIAL_JTAG=y +# end of ESP-Driver:USB Serial/JTAG Configuration + +# +# Ethernet +# +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_SPI_ETHERNET=y +# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set +# CONFIG_ETH_SPI_ETHERNET_W5500 is not set +# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set +# CONFIG_ETH_USE_OPENETH is not set +# CONFIG_ETH_TRANSMIT_MUTEX is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y +# end of Event Loop Library + +# +# GDB Stub +# +CONFIG_ESP_GDBSTUB_ENABLED=y +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +CONFIG_ESP_GDBSTUB_SUPPORT_TASKS=y +CONFIG_ESP_GDBSTUB_MAX_TASKS=32 +# end of GDB Stub + +# +# ESP HTTP client +# +CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y +# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_CUSTOM_TRANSPORT is not set +# end of ESP HTTP client + +# +# HTTP Server +# +CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 +CONFIG_HTTPD_MAX_URI_LEN=512 +CONFIG_HTTPD_ERR_RESP_NO_DELAY=y +CONFIG_HTTPD_PURGE_BUF_LEN=32 +# CONFIG_HTTPD_LOG_PURGE_DATA is not set +# CONFIG_HTTPD_WS_SUPPORT is not set +# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set +# end of HTTP Server + +# +# ESP HTTPS OTA +# +# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set +# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set +# end of ESP HTTPS OTA + +# +# ESP HTTPS server +# +# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +# end of ESP HTTPS server + +# +# Hardware Settings +# + +# +# Chip revision +# +CONFIG_ESP32S3_REV_MIN_0=y +# CONFIG_ESP32S3_REV_MIN_1 is not set +# CONFIG_ESP32S3_REV_MIN_2 is not set +CONFIG_ESP32S3_REV_MIN_FULL=0 +CONFIG_ESP_REV_MIN_FULL=0 + +# +# Maximum Supported ESP32-S3 Revision (Rev v0.99) +# +CONFIG_ESP32S3_REV_MAX_FULL=99 +CONFIG_ESP_REV_MAX_FULL=99 +# end of Chip revision + +# +# MAC Config +# +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# CONFIG_ESP_MAC_USE_CUSTOM_MAC_AS_BASE_MAC is not set +# end of MAC Config + +# +# Sleep Config +# +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU=y +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y +CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y +CONFIG_ESP_SLEEP_WAIT_FLASH_READY_EXTRA_DELAY=2000 +# CONFIG_ESP_SLEEP_CACHE_SAFE_ASSERTION is not set +# CONFIG_ESP_SLEEP_DEBUG is not set +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y +# end of Sleep Config + +# +# RTC Clock Config +# +CONFIG_RTC_CLK_SRC_INT_RC=y +# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_RTC_CLK_CAL_CYCLES=1024 +# end of RTC Clock Config + +# +# Peripheral Control +# +CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y +# end of Peripheral Control + +# +# GDMA Configurations +# +CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y +# CONFIG_GDMA_ISR_IRAM_SAFE is not set +# CONFIG_GDMA_ENABLE_DEBUG_LOG is not set +# end of GDMA Configurations + +# +# Main XTAL Config +# +CONFIG_XTAL_FREQ_40=y +CONFIG_XTAL_FREQ=40 +# end of Main XTAL Config + +CONFIG_ESP_SPI_BUS_LOCK_ISR_FUNCS_IN_IRAM=y +# end of Hardware Settings + +# +# LCD and Touch Panel +# + +# +# LCD Touch Drivers are maintained in the IDF Component Registry +# + +# +# LCD Peripheral Configuration +# +CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 +# CONFIG_LCD_ENABLE_DEBUG_LOG is not set +# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set +# CONFIG_LCD_RGB_RESTART_IN_VSYNC is not set +# end of LCD Peripheral Configuration +# end of LCD and Touch Panel + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +CONFIG_ESP_NETIF_TCPIP_LWIP=y +# CONFIG_ESP_NETIF_LOOPBACK is not set +CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y +# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set +# CONFIG_ESP_NETIF_L2_TAP is not set +# CONFIG_ESP_NETIF_BRIDGE_EN is not set +# end of ESP NETIF Adapter + +# +# Partition API Configuration +# +# end of Partition API Configuration + +# +# PHY +# +CONFIG_ESP_PHY_ENABLED=y +CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP_PHY_MAX_TX_POWER=20 +# CONFIG_ESP_PHY_REDUCE_TX_POWER is not set +CONFIG_ESP_PHY_ENABLE_USB=y +# CONFIG_ESP_PHY_ENABLE_CERT_TEST is not set +CONFIG_ESP_PHY_RF_CAL_PARTIAL=y +# CONFIG_ESP_PHY_RF_CAL_NONE is not set +# CONFIG_ESP_PHY_RF_CAL_FULL is not set +CONFIG_ESP_PHY_CALIBRATION_MODE=0 +# CONFIG_ESP_PHY_PLL_TRACK_DEBUG is not set +# end of PHY + +# +# Power Management +# +# CONFIG_PM_ENABLE is not set +CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y +CONFIG_PM_RESTORE_CACHE_TAGMEM_AFTER_LIGHT_SLEEP=y +# end of Power Management + +# +# ESP PSRAM +# +CONFIG_SPIRAM=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_MODE_QUAD is not set +CONFIG_SPIRAM_MODE_OCT=y +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CLK_IO=30 +CONFIG_SPIRAM_CS_IO=26 +# CONFIG_SPIRAM_XIP_FROM_PSRAM is not set +CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y +CONFIG_SPIRAM_RODATA=y +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM_SPEED=80 +# CONFIG_SPIRAM_ECC_ENABLE is not set +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +# CONFIG_SPIRAM_USE_MEMMAP is not set +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +CONFIG_SPIRAM_USE_MALLOC=y +CONFIG_SPIRAM_MEMTEST=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 +# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# end of SPI RAM config +# end of ESP PSRAM + +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + +# +# ESP System Settings +# +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 is not set +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 + +# +# Cache config +# +CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y +# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y +CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 +# CONFIG_ESP32S3_DATA_CACHE_16KB is not set +CONFIG_ESP32S3_DATA_CACHE_32KB=y +# CONFIG_ESP32S3_DATA_CACHE_64KB is not set +CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 +# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set +CONFIG_ESP32S3_DATA_CACHE_8WAYS=y +CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y +# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 +# end of Cache config + +# +# Memory +# +# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set +# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set +# end of Memory + +# +# Trace memory +# +# CONFIG_ESP32S3_TRAX is not set +CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 +# end of Trace memory + +# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set +CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0 +CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y +CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y + +# +# Memory protection +# +CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=y +CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=y +# end of Memory protection + +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 +CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set +# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_USB_CDC is not set +# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_NONE is not set +# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set +CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y +CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y +CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_ROM_SERIAL_PORT_NUM=0 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y +CONFIG_ESP_TASK_WDT_EN=y +CONFIG_ESP_TASK_WDT_INIT=y +# CONFIG_ESP_TASK_WDT_PANIC is not set +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP_DEBUG_OCDAWARE=y +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y + +# +# Brownout Detector +# +CONFIG_ESP_BROWNOUT_DET=y +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 is not set +CONFIG_ESP_BROWNOUT_DET_LVL=7 +# end of Brownout Detector + +CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y +CONFIG_ESP_SYSTEM_BBPLL_RECALIB=y +# end of ESP System Settings + +# +# IPC (Inter-Processor Call) +# +CONFIG_ESP_IPC_TASK_STACK_SIZE=1280 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y +# end of IPC (Inter-Processor Call) + +# +# ESP Timer (High Resolution Timer) +# +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y +CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 +# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set +CONFIG_ESP_TIMER_TASK_AFFINITY=0x0 +CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y +CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y +# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set +CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# end of ESP Timer (High Resolution Timer) + +# +# Wi-Fi +# +CONFIG_ESP_WIFI_ENABLED=y +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y +CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 +# CONFIG_ESP_WIFI_CSI_ENABLED is not set +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=6 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=6 +# CONFIG_ESP_WIFI_AMSDU_TX_ENABLED is not set +CONFIG_ESP_WIFI_NVS_ENABLED=y +CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP_WIFI_IRAM_OPT=y +# CONFIG_ESP_WIFI_EXTRA_IRAM_OPT is not set +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP_WIFI_ENABLE_SAE_PK=y +CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y +# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +CONFIG_ESP_WIFI_SLP_DEFAULT_MIN_ACTIVE_TIME=50 +CONFIG_ESP_WIFI_SLP_DEFAULT_MAX_ACTIVE_TIME=10 +CONFIG_ESP_WIFI_SLP_DEFAULT_WAIT_BROADCAST_DATA_TIME=15 +# CONFIG_ESP_WIFI_FTM_ENABLE is not set +CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE=y +# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set +# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set +CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 +CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y +CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y +# CONFIG_ESP_WIFI_WAPI_PSK is not set +# CONFIG_ESP_WIFI_SUITE_B_192 is not set +# CONFIG_ESP_WIFI_11KV_SUPPORT is not set +# CONFIG_ESP_WIFI_MBO_SUPPORT is not set +# CONFIG_ESP_WIFI_DPP_SUPPORT is not set +# CONFIG_ESP_WIFI_11R_SUPPORT is not set +# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set + +# +# WPS Configuration Options +# +# CONFIG_ESP_WIFI_WPS_STRICT is not set +# CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set +# end of WPS Configuration Options + +# CONFIG_ESP_WIFI_DEBUG_PRINT is not set +# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set +CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y +# CONFIG_ESP_WIFI_ENT_FREE_DYNAMIC_BUFFER is not set +# end of Wi-Fi + +# +# Core dump +# +# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set +# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set +CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +# end of Core dump + +# +# FAT Filesystem support +# +CONFIG_FATFS_VOLUME_COUNT=2 +CONFIG_FATFS_LFN_NONE=y +# CONFIG_FATFS_LFN_HEAP is not set +# CONFIG_FATFS_LFN_STACK is not set +# CONFIG_FATFS_SECTOR_512 is not set +CONFIG_FATFS_SECTOR_4096=y +# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set +CONFIG_FATFS_CODEPAGE_437=y +# CONFIG_FATFS_CODEPAGE_720 is not set +# CONFIG_FATFS_CODEPAGE_737 is not set +# CONFIG_FATFS_CODEPAGE_771 is not set +# CONFIG_FATFS_CODEPAGE_775 is not set +# CONFIG_FATFS_CODEPAGE_850 is not set +# CONFIG_FATFS_CODEPAGE_852 is not set +# CONFIG_FATFS_CODEPAGE_855 is not set +# CONFIG_FATFS_CODEPAGE_857 is not set +# CONFIG_FATFS_CODEPAGE_860 is not set +# CONFIG_FATFS_CODEPAGE_861 is not set +# CONFIG_FATFS_CODEPAGE_862 is not set +# CONFIG_FATFS_CODEPAGE_863 is not set +# CONFIG_FATFS_CODEPAGE_864 is not set +# CONFIG_FATFS_CODEPAGE_865 is not set +# CONFIG_FATFS_CODEPAGE_866 is not set +# CONFIG_FATFS_CODEPAGE_869 is not set +# CONFIG_FATFS_CODEPAGE_932 is not set +# CONFIG_FATFS_CODEPAGE_936 is not set +# CONFIG_FATFS_CODEPAGE_949 is not set +# CONFIG_FATFS_CODEPAGE_950 is not set +CONFIG_FATFS_CODEPAGE=437 +CONFIG_FATFS_FS_LOCK=0 +CONFIG_FATFS_TIMEOUT_MS=10000 +CONFIG_FATFS_PER_FILE_CACHE=y +CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y +# CONFIG_FATFS_USE_FASTSEEK is not set +CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 +# CONFIG_FATFS_IMMEDIATE_FSYNC is not set +# CONFIG_FATFS_USE_LABEL is not set +CONFIG_FATFS_LINK_LOCK=y +# end of FAT Filesystem support + +# +# FreeRTOS +# + +# +# Kernel +# +# CONFIG_FREERTOS_SMP is not set +# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_HZ=100 +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 +# CONFIG_FREERTOS_USE_IDLE_HOOK is not set +# CONFIG_FREERTOS_USE_TICK_HOOK is not set +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 +# CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY is not set +CONFIG_FREERTOS_TIMER_SERVICE_TASK_NAME="Tmr Svc" +# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU0 is not set +# CONFIG_FREERTOS_TIMER_TASK_AFFINITY_CPU1 is not set +CONFIG_FREERTOS_TIMER_TASK_NO_AFFINITY=y +CONFIG_FREERTOS_TIMER_SERVICE_TASK_CORE_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 +# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +# CONFIG_FREERTOS_USE_LIST_DATA_INTEGRITY_CHECK_BYTES is not set +# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +# CONFIG_FREERTOS_USE_APPLICATION_TASK_TAG is not set +# end of Kernel + +# +# Port +# +CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set +CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y +# CONFIG_FREERTOS_TASK_PRE_DELETION_HOOK is not set +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y +CONFIG_FREERTOS_ISR_STACKSIZE=1536 +CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y +CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y +# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set +CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +# end of Port + +CONFIG_FREERTOS_PORT=y +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y +CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH=y +CONFIG_FREERTOS_NUMBER_OF_CORES=2 +# end of FreeRTOS + +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y +# CONFIG_HAL_ASSERTION_DISABLE is not set +# CONFIG_HAL_ASSERTION_SILENT is not set +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +CONFIG_HAL_WDT_USE_ROM_IMPL=y +CONFIG_HAL_SPI_MASTER_FUNC_IN_IRAM=y +CONFIG_HAL_SPI_SLAVE_FUNC_IN_IRAM=y +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_USE_HOOKS is not set +# CONFIG_HEAP_TASK_TRACKING is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set +# end of Heap memory debugging + +# +# Log output +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=3 +CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set +# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set +CONFIG_LOG_MAXIMUM_LEVEL=3 +# CONFIG_LOG_MASTER_LEVEL is not set +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Log output + +# +# LWIP +# +CONFIG_LWIP_ENABLE=y +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +# CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 +# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set +# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_ND6=y +# CONFIG_LWIP_FORCE_ROUTER_FORWARDING is not set +CONFIG_LWIP_MAX_SOCKETS=10 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set +CONFIG_LWIP_SO_REUSE=y +CONFIG_LWIP_SO_REUSE_RXTOALL=y +# CONFIG_LWIP_SO_RCVBUF is not set +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP_DEFAULT_TTL=64 +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set +CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +CONFIG_LWIP_ESP_MLDV6_REPORT=y +CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +CONFIG_LWIP_DHCP_OPTIONS_LEN=68 +CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 +CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 + +# +# DHCP server +# +CONFIG_LWIP_DHCPS=y +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +CONFIG_LWIP_DHCPS_STATIC_ENTRIES=y +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +CONFIG_LWIP_IPV4=y +CONFIG_LWIP_IPV6=y +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 +# CONFIG_LWIP_IPV6_FORWARD is not set +# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=16 +CONFIG_LWIP_MAX_LISTENING_TCP=16 +CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=12 +CONFIG_LWIP_TCP_MSS=1440 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 +CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCP_ACCEPTMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +CONFIG_LWIP_TCP_OOSEQ_TIMEOUT=6 +CONFIG_LWIP_TCP_OOSEQ_MAX_PBUFS=4 +# CONFIG_LWIP_TCP_SACK_OUT is not set +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=1500 +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +# +# Checksums +# +# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set +# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set +CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y +# end of Checksums + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_LWIP_PPP_SUPPORT is not set +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +# CONFIG_LWIP_SLIP_SUPPORT is not set + +# +# ICMP +# +CONFIG_LWIP_ICMP=y +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_SNTP_MAX_SERVERS=1 +# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +CONFIG_LWIP_SNTP_STARTUP_DELAY=y +CONFIG_LWIP_SNTP_MAXIMUM_STARTUP_DELAY=5000 +# end of SNTP + +# +# DNS +# +CONFIG_LWIP_DNS_MAX_SERVERS=3 +# CONFIG_LWIP_FALLBACK_DNS_SERVER_SUPPORT is not set +# end of DNS + +CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 +CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Hooks +# +# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set +CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y +# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y +# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set +CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y +# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set +# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set +CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y +# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set +# end of Hooks + +# CONFIG_LWIP_DEBUG is not set +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +# CONFIG_MBEDTLS_DEBUG is not set + +# +# mbedTLS v3.x related +# +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set +# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set +# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y +CONFIG_MBEDTLS_PKCS7_C=y +# end of mbedTLS v3.x related + +# +# Certificate Bundle +# +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set +# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEPRECATED_LIST is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 +# end of Certificate Bundle + +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +CONFIG_MBEDTLS_CMAC_C=y +CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_AES_USE_INTERRUPT=y +CONFIG_MBEDTLS_AES_INTERRUPT_LEVEL=0 +CONFIG_MBEDTLS_GCM_SUPPORT_NON_AES_CIPHER=y +CONFIG_MBEDTLS_HARDWARE_MPI=y +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +CONFIG_MBEDTLS_MPI_USE_INTERRUPT=y +CONFIG_MBEDTLS_MPI_INTERRUPT_LEVEL=0 +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_ROM_MD5=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA512_C=y +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +# CONFIG_MBEDTLS_PSK_MODES is not set +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# CONFIG_MBEDTLS_NIST_KW_C is not set +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +# CONFIG_MBEDTLS_DHM_C is not set +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y +CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set +CONFIG_MBEDTLS_ERROR_STRINGS=y +# end of mbedTLS + +# +# ESP-MQTT Configurations +# +CONFIG_MQTT_PROTOCOL_311=y +# CONFIG_MQTT_PROTOCOL_5 is not set +CONFIG_MQTT_TRANSPORT_SSL=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y +# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set +# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set +# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set +# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set +# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set +# CONFIG_MQTT_CUSTOM_OUTBOX is not set +# end of ESP-MQTT Configurations + +# +# Newlib +# +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y +# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set +# end of Newlib + +CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND=y + +# +# NVS +# +# CONFIG_NVS_ENCRYPTION is not set +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set +# CONFIG_NVS_LEGACY_DUP_KEYS_COMPATIBILITY is not set +# end of NVS + +# +# OpenThread +# +# CONFIG_OPENTHREAD_ENABLED is not set + +# +# Thread Operational Dataset +# +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread-ESP" +CONFIG_OPENTHREAD_MESH_LOCAL_PREFIX="fd00:db8:a0:0::/64" +CONFIG_OPENTHREAD_NETWORK_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_PANID=0x1234 +CONFIG_OPENTHREAD_NETWORK_EXTPANID="dead00beef00cafe" +CONFIG_OPENTHREAD_NETWORK_MASTERKEY="00112233445566778899aabbccddeeff" +CONFIG_OPENTHREAD_NETWORK_PSKC="104810e2315100afd6bc9215a6bfac53" +# end of Thread Operational Dataset + +CONFIG_OPENTHREAD_XTAL_ACCURACY=130 +# CONFIG_OPENTHREAD_SPINEL_ONLY is not set +CONFIG_OPENTHREAD_RX_ON_WHEN_IDLE=y + +# +# Thread Address Query Config +# +# end of Thread Address Query Config +# end of OpenThread + +# +# Protocomm +# +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y +# end of Protocomm + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# MMU Config +# +CONFIG_MMU_PAGE_SIZE_64KB=y +CONFIG_MMU_PAGE_MODE="64KB" +CONFIG_MMU_PAGE_SIZE=0x10000 +# end of MMU Config + +# +# Main Flash configuration +# + +# +# SPI Flash behavior when brownout +# +CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y +CONFIG_SPI_FLASH_BROWNOUT_RESET=y +# end of SPI Flash behavior when brownout + +# +# Optional and Experimental Features (READ DOCS FIRST) +# + +# +# Features here require specific hardware (READ DOCS FIRST!) +# +# CONFIG_SPI_FLASH_HPM_ENA is not set +CONFIG_SPI_FLASH_HPM_AUTO=y +# CONFIG_SPI_FLASH_HPM_DIS is not set +CONFIG_SPI_FLASH_HPM_ON=y +CONFIG_SPI_FLASH_HPM_DC_AUTO=y +# CONFIG_SPI_FLASH_HPM_DC_DISABLE is not set +CONFIG_SPI_FLASH_SUSPEND_QVL_SUPPORTED=y +# CONFIG_SPI_FLASH_AUTO_SUSPEND is not set +CONFIG_SPI_FLASH_SUSPEND_TSUS_VAL_US=50 +# end of Optional and Experimental Features (READ DOCS FIRST) +# end of Main Flash configuration + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +# CONFIG_SPI_FLASH_ROM_IMPL is not set +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y +CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 +CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set +# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set +# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_GD_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_ISSI_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_MXIC_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_WINBOND_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_BOYA_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_TH_SUPPORTED=y +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y +# end of Auto-detect flash chips + +CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y +# end of SPI Flash driver + +# +# SPIFFS Configuration +# +CONFIG_SPIFFS_MAX_PARTITIONS=3 + +# +# SPIFFS Cache Configuration +# +CONFIG_SPIFFS_CACHE=y +CONFIG_SPIFFS_CACHE_WR=y +# CONFIG_SPIFFS_CACHE_STATS is not set +# end of SPIFFS Cache Configuration + +CONFIG_SPIFFS_PAGE_CHECK=y +CONFIG_SPIFFS_GC_MAX_RUNS=10 +# CONFIG_SPIFFS_GC_STATS is not set +CONFIG_SPIFFS_PAGE_SIZE=256 +CONFIG_SPIFFS_OBJ_NAME_LEN=32 +# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set +CONFIG_SPIFFS_USE_MAGIC=y +CONFIG_SPIFFS_USE_MAGIC_LENGTH=y +CONFIG_SPIFFS_META_LENGTH=4 +CONFIG_SPIFFS_USE_MTIME=y + +# +# Debug Configuration +# +# CONFIG_SPIFFS_DBG is not set +# CONFIG_SPIFFS_API_DBG is not set +# CONFIG_SPIFFS_GC_DBG is not set +# CONFIG_SPIFFS_CACHE_DBG is not set +# CONFIG_SPIFFS_CHECK_DBG is not set +# CONFIG_SPIFFS_TEST_VISUALISATION is not set +# end of Debug Configuration +# end of SPIFFS Configuration + +# +# TCP Transport +# + +# +# Websocket +# +CONFIG_WS_TRANSPORT=y +CONFIG_WS_BUFFER_SIZE=1024 +# CONFIG_WS_DYNAMIC_BUFFER is not set +# end of Websocket +# end of TCP Transport + +# +# Ultra Low Power (ULP) Co-processor +# +# CONFIG_ULP_COPROC_ENABLED is not set + +# +# ULP Debugging Options +# +# end of ULP Debugging Options +# end of Ultra Low Power (ULP) Co-processor + +# +# Unity unit testing library +# +CONFIG_UNITY_ENABLE_FLOAT=y +CONFIG_UNITY_ENABLE_DOUBLE=y +# CONFIG_UNITY_ENABLE_64BIT is not set +# CONFIG_UNITY_ENABLE_COLOR is not set +CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y +# CONFIG_UNITY_ENABLE_FIXTURE is not set +# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set +# end of Unity unit testing library + +# +# USB-OTG +# +CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 +CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y +# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set +# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set + +# +# Root Hub configuration +# +CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 +CONFIG_USB_HOST_RESET_HOLD_MS=30 +CONFIG_USB_HOST_RESET_RECOVERY_MS=30 +CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 +# end of Root Hub configuration + +# CONFIG_USB_HOST_ENABLE_ENUM_FILTER_CALLBACK is not set +CONFIG_USB_OTG_SUPPORTED=y +# end of USB-OTG + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +# CONFIG_VFS_SELECT_IN_RAM is not set +CONFIG_VFS_SUPPORT_TERMIOS=y +CONFIG_VFS_MAX_COUNT=8 + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# end of Host File System I/O (Semihosting) +# end of Virtual file system + +# +# Wear Levelling +# +# CONFIG_WL_SECTOR_SIZE_512 is not set +CONFIG_WL_SECTOR_SIZE_4096=y +CONFIG_WL_SECTOR_SIZE=4096 +# end of Wear Levelling + +# +# Wi-Fi Provisioning Manager +# +CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 +CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set +CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y +# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set +# end of Wi-Fi Provisioning Manager +# end of Component config + +# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set + +# Deprecated options for backward compatibility +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=3 +# CONFIG_APP_ROLLBACK_ENABLE is not set +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +# CONFIG_FLASHMODE_QIO is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +CONFIG_MONITOR_BAUD=115200 +CONFIG_OPTIMIZATION_LEVEL_DEBUG=y +CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y +CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y +# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +CONFIG_CXX_EXCEPTIONS=y +CONFIG_CXX_EXCEPTIONS_EMG_POOL_SIZE=0 +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +# CONFIG_EXTERNAL_COEX_ENABLE is not set +# CONFIG_ESP_WIFI_EXTERNAL_COEXIST_ENABLE is not set +# CONFIG_MCPWM_ISR_IN_IRAM is not set +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +CONFIG_GDBSTUB_SUPPORT_TASKS=y +CONFIG_GDBSTUB_MAX_TASKS=32 +# CONFIG_OTA_ALLOW_HTTP is not set +CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +# CONFIG_REDUCE_PHY_TX_POWER is not set +# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set +CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y +CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_CONSOLE_UART_NONE is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +CONFIG_TASK_WDT=y +CONFIG_ESP_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP32S3_DEBUG_OCDAWARE=y +CONFIG_BROWNOUT_DET=y +CONFIG_ESP32S3_BROWNOUT_DET=y +CONFIG_ESP32S3_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_7=y +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set +CONFIG_BROWNOUT_DET_LVL=7 +CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 +CONFIG_IPC_TASK_STACK_SIZE=1280 +CONFIG_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP32_WIFI_ENABLED=y +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32 +# CONFIG_ESP32_WIFI_CSI_ENABLED is not set +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP32_WIFI_TX_BA_WIN=6 +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +# CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED is not set +CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP32_WIFI_IRAM_OPT=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y +CONFIG_WPA_MBEDTLS_CRYPTO=y +CONFIG_WPA_MBEDTLS_TLS_CLIENT=y +# CONFIG_WPA_WAPI_PSK is not set +# CONFIG_WPA_SUITE_B_192 is not set +# CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# CONFIG_WPA_11R_SUPPORT is not set +# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set +# CONFIG_WPA_WPS_STRICT is not set +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +# CONFIG_HAL_ASSERTION_SILIENT is not set +# CONFIG_L2_TO_L3_COPY is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=12 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=5744 +CONFIG_TCP_WND_DEFAULT=5744 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_SYSTIMER=y +CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_SYSTIMER is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# End of deprecated options diff --git a/src/portapack-external-module/sdkconfig.old b/src/portapack-external-module/sdkconfig.old new file mode 100644 index 0000000..d958ef0 --- /dev/null +++ b/src/portapack-external-module/sdkconfig.old @@ -0,0 +1,1984 @@ +# +# Automatically generated file. DO NOT EDIT. +# Espressif IoT Development Framework (ESP-IDF) 5.1.2 Project Configuration +# +CONFIG_SOC_MPU_MIN_REGION_SIZE=0x20000000 +CONFIG_SOC_MPU_REGIONS_MAX_NUM=8 +CONFIG_SOC_ADC_SUPPORTED=y +CONFIG_SOC_UART_SUPPORTED=y +CONFIG_SOC_PCNT_SUPPORTED=y +CONFIG_SOC_WIFI_SUPPORTED=y +CONFIG_SOC_TWAI_SUPPORTED=y +CONFIG_SOC_GDMA_SUPPORTED=y +CONFIG_SOC_GPTIMER_SUPPORTED=y +CONFIG_SOC_LCDCAM_SUPPORTED=y +CONFIG_SOC_MCPWM_SUPPORTED=y +CONFIG_SOC_DEDICATED_GPIO_SUPPORTED=y +CONFIG_SOC_CACHE_SUPPORT_WRAP=y +CONFIG_SOC_ULP_SUPPORTED=y +CONFIG_SOC_ULP_FSM_SUPPORTED=y +CONFIG_SOC_RISCV_COPROC_SUPPORTED=y +CONFIG_SOC_BT_SUPPORTED=y +CONFIG_SOC_USB_OTG_SUPPORTED=y +CONFIG_SOC_USB_SERIAL_JTAG_SUPPORTED=y +CONFIG_SOC_CCOMP_TIMER_SUPPORTED=y +CONFIG_SOC_ASYNC_MEMCPY_SUPPORTED=y +CONFIG_SOC_SUPPORTS_SECURE_DL_MODE=y +CONFIG_SOC_EFUSE_KEY_PURPOSE_FIELD=y +CONFIG_SOC_SDMMC_HOST_SUPPORTED=y +CONFIG_SOC_RTC_FAST_MEM_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_MEM_SUPPORTED=y +CONFIG_SOC_RTC_MEM_SUPPORTED=y +CONFIG_SOC_PSRAM_DMA_CAPABLE=y +CONFIG_SOC_XT_WDT_SUPPORTED=y +CONFIG_SOC_I2S_SUPPORTED=y +CONFIG_SOC_RMT_SUPPORTED=y +CONFIG_SOC_SDM_SUPPORTED=y +CONFIG_SOC_GPSPI_SUPPORTED=y +CONFIG_SOC_LEDC_SUPPORTED=y +CONFIG_SOC_I2C_SUPPORTED=y +CONFIG_SOC_SYSTIMER_SUPPORTED=y +CONFIG_SOC_SUPPORT_COEXISTENCE=y +CONFIG_SOC_TEMP_SENSOR_SUPPORTED=y +CONFIG_SOC_AES_SUPPORTED=y +CONFIG_SOC_MPI_SUPPORTED=y +CONFIG_SOC_SHA_SUPPORTED=y +CONFIG_SOC_HMAC_SUPPORTED=y +CONFIG_SOC_DIG_SIGN_SUPPORTED=y +CONFIG_SOC_FLASH_ENC_SUPPORTED=y +CONFIG_SOC_SECURE_BOOT_SUPPORTED=y +CONFIG_SOC_MEMPROT_SUPPORTED=y +CONFIG_SOC_TOUCH_SENSOR_SUPPORTED=y +CONFIG_SOC_BOD_SUPPORTED=y +CONFIG_SOC_XTAL_SUPPORT_40M=y +CONFIG_SOC_APPCPU_HAS_CLOCK_GATING_BUG=y +CONFIG_SOC_ADC_RTC_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_DIG_CTRL_SUPPORTED=y +CONFIG_SOC_ADC_ARBITER_SUPPORTED=y +CONFIG_SOC_ADC_DIG_IIR_FILTER_SUPPORTED=y +CONFIG_SOC_ADC_MONITOR_SUPPORTED=y +CONFIG_SOC_ADC_DMA_SUPPORTED=y +CONFIG_SOC_ADC_PERIPH_NUM=2 +CONFIG_SOC_ADC_MAX_CHANNEL_NUM=10 +CONFIG_SOC_ADC_ATTEN_NUM=4 +CONFIG_SOC_ADC_DIGI_CONTROLLER_NUM=2 +CONFIG_SOC_ADC_PATT_LEN_MAX=24 +CONFIG_SOC_ADC_DIGI_MIN_BITWIDTH=12 +CONFIG_SOC_ADC_DIGI_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_DIGI_RESULT_BYTES=4 +CONFIG_SOC_ADC_DIGI_DATA_BYTES_PER_CONV=4 +CONFIG_SOC_ADC_DIGI_IIR_FILTER_NUM=2 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_HIGH=83333 +CONFIG_SOC_ADC_SAMPLE_FREQ_THRES_LOW=611 +CONFIG_SOC_ADC_RTC_MIN_BITWIDTH=12 +CONFIG_SOC_ADC_RTC_MAX_BITWIDTH=12 +CONFIG_SOC_ADC_CALIBRATION_V1_SUPPORTED=y +CONFIG_SOC_ADC_SELF_HW_CALI_SUPPORTED=y +CONFIG_SOC_APB_BACKUP_DMA=y +CONFIG_SOC_BROWNOUT_RESET_SUPPORTED=y +CONFIG_SOC_CACHE_WRITEBACK_SUPPORTED=y +CONFIG_SOC_CACHE_FREEZE_SUPPORTED=y +CONFIG_SOC_CPU_CORES_NUM=2 +CONFIG_SOC_CPU_INTR_NUM=32 +CONFIG_SOC_CPU_HAS_FPU=y +CONFIG_SOC_CPU_BREAKPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINTS_NUM=2 +CONFIG_SOC_CPU_WATCHPOINT_SIZE=64 +CONFIG_SOC_DS_SIGNATURE_MAX_BIT_LEN=4096 +CONFIG_SOC_DS_KEY_PARAM_MD_IV_LENGTH=16 +CONFIG_SOC_DS_KEY_CHECK_MAX_WAIT_US=1100 +CONFIG_SOC_GDMA_GROUPS=y +CONFIG_SOC_GDMA_PAIRS_PER_GROUP=5 +CONFIG_SOC_GDMA_SUPPORT_PSRAM=y +CONFIG_SOC_GPIO_PORT=1 +CONFIG_SOC_GPIO_PIN_COUNT=49 +CONFIG_SOC_GPIO_SUPPORT_PIN_GLITCH_FILTER=y +CONFIG_SOC_GPIO_FILTER_CLK_SUPPORT_APB=y +CONFIG_SOC_GPIO_SUPPORT_RTC_INDEPENDENT=y +CONFIG_SOC_GPIO_SUPPORT_FORCE_HOLD=y +CONFIG_SOC_GPIO_VALID_GPIO_MASK=0x1FFFFFFFFFFFF +CONFIG_SOC_GPIO_VALID_DIGITAL_IO_PAD_MASK=0x0001FFFFFC000000 +CONFIG_SOC_DEDIC_GPIO_OUT_CHANNELS_NUM=8 +CONFIG_SOC_DEDIC_GPIO_IN_CHANNELS_NUM=8 +CONFIG_SOC_DEDIC_GPIO_OUT_AUTO_ENABLE=y +CONFIG_SOC_I2C_NUM=2 +CONFIG_SOC_I2C_FIFO_LEN=32 +CONFIG_SOC_I2C_CMD_REG_NUM=8 +CONFIG_SOC_I2C_SUPPORT_SLAVE=y +CONFIG_SOC_I2C_SUPPORT_HW_CLR_BUS=y +CONFIG_SOC_I2C_SUPPORT_XTAL=y +CONFIG_SOC_I2C_SUPPORT_RTC=y +CONFIG_SOC_I2S_NUM=2 +CONFIG_SOC_I2S_HW_VERSION_2=y +CONFIG_SOC_I2S_SUPPORTS_XTAL=y +CONFIG_SOC_I2S_SUPPORTS_PLL_F160M=y +CONFIG_SOC_I2S_SUPPORTS_PCM=y +CONFIG_SOC_I2S_SUPPORTS_PDM=y +CONFIG_SOC_I2S_SUPPORTS_PDM_TX=y +CONFIG_SOC_I2S_PDM_MAX_TX_LINES=2 +CONFIG_SOC_I2S_SUPPORTS_PDM_RX=y +CONFIG_SOC_I2S_PDM_MAX_RX_LINES=4 +CONFIG_SOC_I2S_SUPPORTS_TDM=y +CONFIG_SOC_LEDC_SUPPORT_APB_CLOCK=y +CONFIG_SOC_LEDC_SUPPORT_XTAL_CLOCK=y +CONFIG_SOC_LEDC_CHANNEL_NUM=8 +CONFIG_SOC_LEDC_TIMER_BIT_WIDTH=14 +CONFIG_SOC_LEDC_SUPPORT_FADE_STOP=y +CONFIG_SOC_MCPWM_GROUPS=2 +CONFIG_SOC_MCPWM_TIMERS_PER_GROUP=3 +CONFIG_SOC_MCPWM_OPERATORS_PER_GROUP=3 +CONFIG_SOC_MCPWM_COMPARATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GENERATORS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_TRIGGERS_PER_OPERATOR=2 +CONFIG_SOC_MCPWM_GPIO_FAULTS_PER_GROUP=3 +CONFIG_SOC_MCPWM_CAPTURE_TIMERS_PER_GROUP=y +CONFIG_SOC_MCPWM_CAPTURE_CHANNELS_PER_TIMER=3 +CONFIG_SOC_MCPWM_GPIO_SYNCHROS_PER_GROUP=3 +CONFIG_SOC_MCPWM_SWSYNC_CAN_PROPAGATE=y +CONFIG_SOC_MMU_LINEAR_ADDRESS_REGION_NUM=1 +CONFIG_SOC_MMU_PERIPH_NUM=1 +CONFIG_SOC_PCNT_GROUPS=1 +CONFIG_SOC_PCNT_UNITS_PER_GROUP=4 +CONFIG_SOC_PCNT_CHANNELS_PER_UNIT=2 +CONFIG_SOC_PCNT_THRES_POINT_PER_UNIT=2 +CONFIG_SOC_RMT_GROUPS=1 +CONFIG_SOC_RMT_TX_CANDIDATES_PER_GROUP=4 +CONFIG_SOC_RMT_RX_CANDIDATES_PER_GROUP=4 +CONFIG_SOC_RMT_CHANNELS_PER_GROUP=8 +CONFIG_SOC_RMT_MEM_WORDS_PER_CHANNEL=48 +CONFIG_SOC_RMT_SUPPORT_RX_PINGPONG=y +CONFIG_SOC_RMT_SUPPORT_RX_DEMODULATION=y +CONFIG_SOC_RMT_SUPPORT_TX_ASYNC_STOP=y +CONFIG_SOC_RMT_SUPPORT_TX_LOOP_COUNT=y +CONFIG_SOC_RMT_SUPPORT_TX_LOOP_AUTO_STOP=y +CONFIG_SOC_RMT_SUPPORT_TX_SYNCHRO=y +CONFIG_SOC_RMT_SUPPORT_TX_CARRIER_DATA_ONLY=y +CONFIG_SOC_RMT_SUPPORT_XTAL=y +CONFIG_SOC_RMT_SUPPORT_RC_FAST=y +CONFIG_SOC_RMT_SUPPORT_APB=y +CONFIG_SOC_RMT_SUPPORT_DMA=y +CONFIG_SOC_LCD_I80_SUPPORTED=y +CONFIG_SOC_LCD_RGB_SUPPORTED=y +CONFIG_SOC_LCD_I80_BUSES=1 +CONFIG_SOC_LCD_RGB_PANELS=1 +CONFIG_SOC_LCD_I80_BUS_WIDTH=16 +CONFIG_SOC_LCD_RGB_DATA_WIDTH=16 +CONFIG_SOC_LCD_SUPPORT_RGB_YUV_CONV=y +CONFIG_SOC_RTC_CNTL_CPU_PD_DMA_BUS_WIDTH=128 +CONFIG_SOC_RTC_CNTL_CPU_PD_REG_FILE_NUM=549 +CONFIG_SOC_RTC_CNTL_TAGMEM_PD_DMA_BUS_WIDTH=128 +CONFIG_SOC_RTCIO_PIN_COUNT=22 +CONFIG_SOC_RTCIO_INPUT_OUTPUT_SUPPORTED=y +CONFIG_SOC_RTCIO_HOLD_SUPPORTED=y +CONFIG_SOC_RTCIO_WAKE_SUPPORTED=y +CONFIG_SOC_SDM_GROUPS=y +CONFIG_SOC_SDM_CHANNELS_PER_GROUP=8 +CONFIG_SOC_SDM_CLK_SUPPORT_APB=y +CONFIG_SOC_SPI_PERIPH_NUM=3 +CONFIG_SOC_SPI_MAX_CS_NUM=6 +CONFIG_SOC_SPI_MAXIMUM_BUFFER_SIZE=64 +CONFIG_SOC_SPI_SUPPORT_DDRCLK=y +CONFIG_SOC_SPI_SLAVE_SUPPORT_SEG_TRANS=y +CONFIG_SOC_SPI_SUPPORT_CD_SIG=y +CONFIG_SOC_SPI_SUPPORT_CONTINUOUS_TRANS=y +CONFIG_SOC_SPI_SUPPORT_SLAVE_HD_VER2=y +CONFIG_SOC_SPI_SUPPORT_CLK_APB=y +CONFIG_SOC_SPI_SUPPORT_CLK_XTAL=y +CONFIG_SOC_SPI_PERIPH_SUPPORT_CONTROL_DUMMY_OUT=y +CONFIG_SOC_MEMSPI_IS_INDEPENDENT=y +CONFIG_SOC_SPI_MAX_PRE_DIVIDER=16 +CONFIG_SOC_SPI_SUPPORT_OCT=y +CONFIG_SOC_MEMSPI_SRC_FREQ_120M=y +CONFIG_SOC_MEMSPI_SRC_FREQ_80M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_40M_SUPPORTED=y +CONFIG_SOC_MEMSPI_SRC_FREQ_20M_SUPPORTED=y +CONFIG_SOC_SPIRAM_SUPPORTED=y +CONFIG_SOC_SPIRAM_XIP_SUPPORTED=y +CONFIG_SOC_SYSTIMER_COUNTER_NUM=2 +CONFIG_SOC_SYSTIMER_ALARM_NUM=3 +CONFIG_SOC_SYSTIMER_BIT_WIDTH_LO=32 +CONFIG_SOC_SYSTIMER_BIT_WIDTH_HI=20 +CONFIG_SOC_SYSTIMER_FIXED_DIVIDER=y +CONFIG_SOC_SYSTIMER_INT_LEVEL=y +CONFIG_SOC_SYSTIMER_ALARM_MISS_COMPENSATE=y +CONFIG_SOC_TIMER_GROUPS=2 +CONFIG_SOC_TIMER_GROUP_TIMERS_PER_GROUP=2 +CONFIG_SOC_TIMER_GROUP_COUNTER_BIT_WIDTH=54 +CONFIG_SOC_TIMER_GROUP_SUPPORT_XTAL=y +CONFIG_SOC_TIMER_GROUP_SUPPORT_APB=y +CONFIG_SOC_TIMER_GROUP_TOTAL_TIMERS=4 +CONFIG_SOC_TOUCH_VERSION_2=y +CONFIG_SOC_TOUCH_SENSOR_NUM=15 +CONFIG_SOC_TOUCH_PROXIMITY_CHANNEL_NUM=3 +CONFIG_SOC_TOUCH_PROXIMITY_MEAS_DONE_SUPPORTED=y +CONFIG_SOC_TOUCH_PAD_THRESHOLD_MAX=0x1FFFFF +CONFIG_SOC_TOUCH_PAD_MEASURE_WAIT_MAX=0xFF +CONFIG_SOC_TWAI_CONTROLLER_NUM=1 +CONFIG_SOC_TWAI_CLK_SUPPORT_APB=y +CONFIG_SOC_TWAI_BRP_MIN=2 +CONFIG_SOC_TWAI_BRP_MAX=16384 +CONFIG_SOC_TWAI_SUPPORTS_RX_STATUS=y +CONFIG_SOC_UART_NUM=3 +CONFIG_SOC_UART_FIFO_LEN=128 +CONFIG_SOC_UART_BITRATE_MAX=5000000 +CONFIG_SOC_UART_SUPPORT_FSM_TX_WAIT_SEND=y +CONFIG_SOC_UART_SUPPORT_WAKEUP_INT=y +CONFIG_SOC_UART_SUPPORT_APB_CLK=y +CONFIG_SOC_UART_SUPPORT_RTC_CLK=y +CONFIG_SOC_UART_SUPPORT_XTAL_CLK=y +CONFIG_SOC_UART_REQUIRE_CORE_RESET=y +CONFIG_SOC_USB_PERIPH_NUM=y +CONFIG_SOC_SHA_DMA_MAX_BUFFER_SIZE=3968 +CONFIG_SOC_SHA_SUPPORT_DMA=y +CONFIG_SOC_SHA_SUPPORT_RESUME=y +CONFIG_SOC_SHA_GDMA=y +CONFIG_SOC_SHA_SUPPORT_SHA1=y +CONFIG_SOC_SHA_SUPPORT_SHA224=y +CONFIG_SOC_SHA_SUPPORT_SHA256=y +CONFIG_SOC_SHA_SUPPORT_SHA384=y +CONFIG_SOC_SHA_SUPPORT_SHA512=y +CONFIG_SOC_SHA_SUPPORT_SHA512_224=y +CONFIG_SOC_SHA_SUPPORT_SHA512_256=y +CONFIG_SOC_SHA_SUPPORT_SHA512_T=y +CONFIG_SOC_RSA_MAX_BIT_LEN=4096 +CONFIG_SOC_AES_SUPPORT_DMA=y +CONFIG_SOC_AES_GDMA=y +CONFIG_SOC_AES_SUPPORT_AES_128=y +CONFIG_SOC_AES_SUPPORT_AES_256=y +CONFIG_SOC_PM_SUPPORT_EXT0_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT1_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_EXT_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_WIFI_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_BT_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_TOUCH_SENSOR_WAKEUP=y +CONFIG_SOC_PM_SUPPORT_CPU_PD=y +CONFIG_SOC_PM_SUPPORT_TAGMEM_PD=y +CONFIG_SOC_PM_SUPPORT_RTC_PERIPH_PD=y +CONFIG_SOC_PM_SUPPORT_RC_FAST_PD=y +CONFIG_SOC_PM_SUPPORT_VDDSDIO_PD=y +CONFIG_SOC_PM_SUPPORT_MAC_BB_PD=y +CONFIG_SOC_PM_SUPPORT_MODEM_PD=y +CONFIG_SOC_CONFIGURABLE_VDDSDIO_SUPPORTED=y +CONFIG_SOC_PM_SUPPORT_DEEPSLEEP_CHECK_STUB_ONLY=y +CONFIG_SOC_PM_CPU_RETENTION_BY_RTCCNTL=y +CONFIG_SOC_PM_MODEM_RETENTION_BY_BACKUPDMA=y +CONFIG_SOC_CLK_RC_FAST_D256_SUPPORTED=y +CONFIG_SOC_RTC_SLOW_CLK_SUPPORT_RC_FAST_D256=y +CONFIG_SOC_CLK_RC_FAST_SUPPORT_CALIBRATION=y +CONFIG_SOC_CLK_XTAL32K_SUPPORTED=y +CONFIG_SOC_EFUSE_DIS_DOWNLOAD_ICACHE=y +CONFIG_SOC_EFUSE_DIS_DOWNLOAD_DCACHE=y +CONFIG_SOC_EFUSE_HARD_DIS_JTAG=y +CONFIG_SOC_EFUSE_DIS_USB_JTAG=y +CONFIG_SOC_EFUSE_SOFT_DIS_JTAG=y +CONFIG_SOC_EFUSE_DIS_DIRECT_BOOT=y +CONFIG_SOC_EFUSE_DIS_ICACHE=y +CONFIG_SOC_EFUSE_BLOCK9_KEY_PURPOSE_QUIRK=y +CONFIG_SOC_SECURE_BOOT_V2_RSA=y +CONFIG_SOC_EFUSE_SECURE_BOOT_KEY_DIGESTS=3 +CONFIG_SOC_EFUSE_REVOKE_BOOT_KEY_DIGESTS=y +CONFIG_SOC_SUPPORT_SECURE_BOOT_REVOKE_KEY=y +CONFIG_SOC_FLASH_ENCRYPTED_XTS_AES_BLOCK_MAX=64 +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES=y +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_OPTIONS=y +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_128=y +CONFIG_SOC_FLASH_ENCRYPTION_XTS_AES_256=y +CONFIG_SOC_MEMPROT_CPU_PREFETCH_PAD_SIZE=16 +CONFIG_SOC_MEMPROT_MEM_ALIGN_SIZE=256 +CONFIG_SOC_PHY_DIG_REGS_MEM_SIZE=21 +CONFIG_SOC_MAC_BB_PD_MEM_SIZE=192 +CONFIG_SOC_WIFI_LIGHT_SLEEP_CLK_WIDTH=12 +CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_WAIT_IDLE=y +CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_SUSPEND=y +CONFIG_SOC_SPI_MEM_SUPPORT_AUTO_RESUME=y +CONFIG_SOC_SPI_MEM_SUPPORT_SW_SUSPEND=y +CONFIG_SOC_SPI_MEM_SUPPORT_OPI_MODE=y +CONFIG_SOC_SPI_MEM_SUPPORT_TIME_TUNING=y +CONFIG_SOC_SPI_MEM_SUPPORT_CONFIG_GPIO_BY_EFUSE=y +CONFIG_SOC_SPI_MEM_SUPPORT_WRAP=y +CONFIG_SOC_COEX_HW_PTI=y +CONFIG_SOC_EXTERNAL_COEX_LEADER_TX_LINE=y +CONFIG_SOC_SDMMC_USE_GPIO_MATRIX=y +CONFIG_SOC_SDMMC_NUM_SLOTS=2 +CONFIG_SOC_SDMMC_SUPPORT_XTAL_CLOCK=y +CONFIG_SOC_TEMPERATURE_SENSOR_SUPPORT_FAST_RC=y +CONFIG_SOC_WIFI_HW_TSF=y +CONFIG_SOC_WIFI_FTM_SUPPORT=y +CONFIG_SOC_WIFI_GCMP_SUPPORT=y +CONFIG_SOC_WIFI_WAPI_SUPPORT=y +CONFIG_SOC_WIFI_CSI_SUPPORT=y +CONFIG_SOC_WIFI_MESH_SUPPORT=y +CONFIG_SOC_WIFI_SUPPORT_VARIABLE_BEACON_WINDOW=y +CONFIG_SOC_BLE_SUPPORTED=y +CONFIG_SOC_BLE_MESH_SUPPORTED=y +CONFIG_SOC_BLE_50_SUPPORTED=y +CONFIG_SOC_BLE_DEVICE_PRIVACY_SUPPORTED=y +CONFIG_SOC_BLUFI_SUPPORTED=y +CONFIG_SOC_ULP_HAS_ADC=y +CONFIG_SOC_PHY_COMBO_MODULE=y +CONFIG_IDF_CMAKE=y +CONFIG_IDF_TARGET_ARCH_XTENSA=y +CONFIG_IDF_TARGET_ARCH="xtensa" +CONFIG_IDF_TARGET="esp32s3" +CONFIG_IDF_TARGET_ESP32S3=y +CONFIG_IDF_FIRMWARE_CHIP_ID=0x0009 + +# +# Build type +# +CONFIG_APP_BUILD_TYPE_APP_2NDBOOT=y +# CONFIG_APP_BUILD_TYPE_RAM is not set +CONFIG_APP_BUILD_GENERATE_BINARIES=y +CONFIG_APP_BUILD_BOOTLOADER=y +CONFIG_APP_BUILD_USE_FLASH_SECTIONS=y +# CONFIG_APP_REPRODUCIBLE_BUILD is not set +# CONFIG_APP_NO_BLOBS is not set +# end of Build type + +# +# Bootloader config +# +CONFIG_BOOTLOADER_OFFSET_IN_FLASH=0x0 +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_DEBUG is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_NONE is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_ERROR is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_WARN is not set +CONFIG_BOOTLOADER_LOG_LEVEL_INFO=y +# CONFIG_BOOTLOADER_LOG_LEVEL_DEBUG is not set +# CONFIG_BOOTLOADER_LOG_LEVEL_VERBOSE is not set +CONFIG_BOOTLOADER_LOG_LEVEL=3 +CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y +# CONFIG_BOOTLOADER_FACTORY_RESET is not set +# CONFIG_BOOTLOADER_APP_TEST is not set +CONFIG_BOOTLOADER_REGION_PROTECTION_ENABLE=y +CONFIG_BOOTLOADER_WDT_ENABLE=y +# CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE is not set +CONFIG_BOOTLOADER_WDT_TIME_MS=9000 +# CONFIG_BOOTLOADER_APP_ROLLBACK_ENABLE is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_IN_DEEP_SLEEP is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ON_POWER_ON is not set +# CONFIG_BOOTLOADER_SKIP_VALIDATE_ALWAYS is not set +CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 +# CONFIG_BOOTLOADER_CUSTOM_RESERVE_RTC is not set +CONFIG_BOOTLOADER_FLASH_XMC_SUPPORT=y +# end of Bootloader config + +# +# Security features +# +CONFIG_SECURE_BOOT_V2_RSA_SUPPORTED=y +CONFIG_SECURE_BOOT_V2_PREFERRED=y +# CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT is not set +# CONFIG_SECURE_BOOT is not set +# CONFIG_SECURE_FLASH_ENC_ENABLED is not set +CONFIG_SECURE_ROM_DL_MODE_ENABLED=y +# end of Security features + +# +# Application manager +# +CONFIG_APP_COMPILE_TIME_DATE=y +# CONFIG_APP_EXCLUDE_PROJECT_VER_VAR is not set +# CONFIG_APP_EXCLUDE_PROJECT_NAME_VAR is not set +# CONFIG_APP_PROJECT_VER_FROM_CONFIG is not set +CONFIG_APP_RETRIEVE_LEN_ELF_SHA=16 +# end of Application manager + +CONFIG_ESP_ROM_HAS_CRC_LE=y +CONFIG_ESP_ROM_HAS_CRC_BE=y +CONFIG_ESP_ROM_HAS_MZ_CRC32=y +CONFIG_ESP_ROM_HAS_JPEG_DECODE=y +CONFIG_ESP_ROM_UART_CLK_IS_XTAL=y +CONFIG_ESP_ROM_HAS_RETARGETABLE_LOCKING=y +CONFIG_ESP_ROM_USB_SERIAL_DEVICE_NUM=4 +CONFIG_ESP_ROM_HAS_ERASE_0_REGION_BUG=y +CONFIG_ESP_ROM_GET_CLK_FREQ=y +CONFIG_ESP_ROM_HAS_HAL_WDT=y +CONFIG_ESP_ROM_NEEDS_SWSETUP_WORKAROUND=y +CONFIG_ESP_ROM_HAS_LAYOUT_TABLE=y +CONFIG_ESP_ROM_HAS_SPI_FLASH=y +CONFIG_ESP_ROM_HAS_ETS_PRINTF_BUG=y +CONFIG_ESP_ROM_HAS_NEWLIB_NANO_FORMAT=y +CONFIG_ESP_ROM_NEEDS_SET_CACHE_MMU_SIZE=y +CONFIG_ESP_ROM_RAM_APP_NEEDS_MMU_INIT=y +CONFIG_ESP_ROM_HAS_FLASH_COUNT_PAGES_BUG=y +CONFIG_ESP_ROM_HAS_CACHE_SUSPEND_WAITI_BUG=y +CONFIG_ESP_ROM_HAS_CACHE_WRITEBACK_BUG=y + +# +# Boot ROM Behavior +# +CONFIG_BOOT_ROM_LOG_ALWAYS_ON=y +# CONFIG_BOOT_ROM_LOG_ALWAYS_OFF is not set +# CONFIG_BOOT_ROM_LOG_ON_GPIO_HIGH is not set +# CONFIG_BOOT_ROM_LOG_ON_GPIO_LOW is not set +# end of Boot ROM Behavior + +# +# Serial flasher config +# +# CONFIG_ESPTOOLPY_NO_STUB is not set +# CONFIG_ESPTOOLPY_OCT_FLASH is not set +CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=y +# CONFIG_ESPTOOLPY_FLASHMODE_QIO is not set +# CONFIG_ESPTOOLPY_FLASHMODE_QOUT is not set +CONFIG_ESPTOOLPY_FLASHMODE_DIO=y +# CONFIG_ESPTOOLPY_FLASHMODE_DOUT is not set +CONFIG_ESPTOOLPY_FLASH_SAMPLE_MODE_STR=y +CONFIG_ESPTOOLPY_FLASHMODE="dio" +# CONFIG_ESPTOOLPY_FLASHFREQ_120M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_80M=y +# CONFIG_ESPTOOLPY_FLASHFREQ_40M is not set +# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set +CONFIG_ESPTOOLPY_FLASHFREQ_80M_DEFAULT=y +CONFIG_ESPTOOLPY_FLASHFREQ="80m" +# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y +# CONFIG_ESPTOOLPY_FLASHSIZE_32MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_64MB is not set +# CONFIG_ESPTOOLPY_FLASHSIZE_128MB is not set +CONFIG_ESPTOOLPY_FLASHSIZE="16MB" +# CONFIG_ESPTOOLPY_HEADER_FLASHSIZE_UPDATE is not set +CONFIG_ESPTOOLPY_BEFORE_RESET=y +# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set +CONFIG_ESPTOOLPY_BEFORE="default_reset" +CONFIG_ESPTOOLPY_AFTER_RESET=y +# CONFIG_ESPTOOLPY_AFTER_NORESET is not set +CONFIG_ESPTOOLPY_AFTER="hard_reset" +CONFIG_ESPTOOLPY_MONITOR_BAUD=115200 +# end of Serial flasher config + +# +# Partition Table +# +CONFIG_PARTITION_TABLE_SINGLE_APP=y +# CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE is not set +# CONFIG_PARTITION_TABLE_TWO_OTA is not set +# CONFIG_PARTITION_TABLE_CUSTOM is not set +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv" +CONFIG_PARTITION_TABLE_OFFSET=0x8000 +CONFIG_PARTITION_TABLE_MD5=y +# end of Partition Table + +# +# Compiler options +# +CONFIG_COMPILER_OPTIMIZATION_DEFAULT=y +# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set +# CONFIG_COMPILER_OPTIMIZATION_PERF is not set +# CONFIG_COMPILER_OPTIMIZATION_NONE is not set +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_ENABLE=y +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE is not set +CONFIG_COMPILER_FLOAT_LIB_FROM_GCCLIB=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT is not set +CONFIG_COMPILER_HIDE_PATHS_MACROS=y +# CONFIG_COMPILER_CXX_EXCEPTIONS is not set +# CONFIG_COMPILER_CXX_RTTI is not set +CONFIG_COMPILER_STACK_CHECK_MODE_NONE=y +# CONFIG_COMPILER_STACK_CHECK_MODE_NORM is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_STRONG is not set +# CONFIG_COMPILER_STACK_CHECK_MODE_ALL is not set +# CONFIG_COMPILER_WARN_WRITE_STRINGS is not set +# CONFIG_COMPILER_DISABLE_GCC12_WARNINGS is not set +# CONFIG_COMPILER_DUMP_RTL_FILES is not set +# end of Compiler options + +# +# Component config +# + +# +# Application Level Tracing +# +# CONFIG_APPTRACE_DEST_JTAG is not set +CONFIG_APPTRACE_DEST_NONE=y +# CONFIG_APPTRACE_DEST_UART1 is not set +# CONFIG_APPTRACE_DEST_UART2 is not set +# CONFIG_APPTRACE_DEST_USB_CDC is not set +CONFIG_APPTRACE_DEST_UART_NONE=y +CONFIG_APPTRACE_UART_TASK_PRIO=1 +CONFIG_APPTRACE_LOCK_ENABLE=y +# end of Application Level Tracing + +# +# Bluetooth +# +# CONFIG_BT_ENABLED is not set +# end of Bluetooth + +# +# Driver Configurations +# + +# +# Legacy ADC Configuration +# +# CONFIG_ADC_SUPPRESS_DEPRECATE_WARN is not set + +# +# Legacy ADC Calibration Configuration +# +# CONFIG_ADC_CALI_SUPPRESS_DEPRECATE_WARN is not set +# end of Legacy ADC Calibration Configuration +# end of Legacy ADC Configuration + +# +# SPI Configuration +# +# CONFIG_SPI_MASTER_IN_IRAM is not set +CONFIG_SPI_MASTER_ISR_IN_IRAM=y +# CONFIG_SPI_SLAVE_IN_IRAM is not set +CONFIG_SPI_SLAVE_ISR_IN_IRAM=y +# end of SPI Configuration + +# +# TWAI Configuration +# +# CONFIG_TWAI_ISR_IN_IRAM is not set +CONFIG_TWAI_ERRATA_FIX_LISTEN_ONLY_DOM=y +# end of TWAI Configuration + +# +# Temperature sensor Configuration +# +# CONFIG_TEMP_SENSOR_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_TEMP_SENSOR_ENABLE_DEBUG_LOG is not set +# end of Temperature sensor Configuration + +# +# UART Configuration +# +# CONFIG_UART_ISR_IN_IRAM is not set +# end of UART Configuration + +# +# GPIO Configuration +# +# CONFIG_GPIO_CTRL_FUNC_IN_IRAM is not set +# end of GPIO Configuration + +# +# Sigma Delta Modulator Configuration +# +# CONFIG_SDM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_SDM_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_SDM_ENABLE_DEBUG_LOG is not set +# end of Sigma Delta Modulator Configuration + +# +# GPTimer Configuration +# +CONFIG_GPTIMER_ISR_HANDLER_IN_IRAM=y +# CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM is not set +# CONFIG_GPTIMER_ISR_IRAM_SAFE is not set +# CONFIG_GPTIMER_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_GPTIMER_ENABLE_DEBUG_LOG is not set +# end of GPTimer Configuration + +# +# PCNT Configuration +# +# CONFIG_PCNT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_PCNT_ISR_IRAM_SAFE is not set +# CONFIG_PCNT_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_PCNT_ENABLE_DEBUG_LOG is not set +# end of PCNT Configuration + +# +# RMT Configuration +# +# CONFIG_RMT_ISR_IRAM_SAFE is not set +# CONFIG_RMT_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_RMT_ENABLE_DEBUG_LOG is not set +# end of RMT Configuration + +# +# MCPWM Configuration +# +# CONFIG_MCPWM_ISR_IRAM_SAFE is not set +# CONFIG_MCPWM_CTRL_FUNC_IN_IRAM is not set +# CONFIG_MCPWM_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_MCPWM_ENABLE_DEBUG_LOG is not set +# end of MCPWM Configuration + +# +# I2S Configuration +# +# CONFIG_I2S_ISR_IRAM_SAFE is not set +# CONFIG_I2S_SUPPRESS_DEPRECATE_WARN is not set +# CONFIG_I2S_ENABLE_DEBUG_LOG is not set +# end of I2S Configuration + +# +# USB Serial/JTAG Configuration +# +# end of USB Serial/JTAG Configuration +# end of Driver Configurations + +# +# eFuse Bit Manager +# +# CONFIG_EFUSE_CUSTOM_TABLE is not set +# CONFIG_EFUSE_VIRTUAL is not set +CONFIG_EFUSE_MAX_BLK_LEN=256 +# end of eFuse Bit Manager + +# +# ESP-TLS +# +CONFIG_ESP_TLS_USING_MBEDTLS=y +CONFIG_ESP_TLS_USE_DS_PERIPHERAL=y +# CONFIG_ESP_TLS_CLIENT_SESSION_TICKETS is not set +# CONFIG_ESP_TLS_SERVER is not set +# CONFIG_ESP_TLS_PSK_VERIFICATION is not set +# CONFIG_ESP_TLS_INSECURE is not set +# end of ESP-TLS + +# +# ADC and ADC Calibration +# +# CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM is not set +# CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE is not set +# CONFIG_ADC_CONTINUOUS_FORCE_USE_ADC2_ON_C3_S3 is not set +# end of ADC and ADC Calibration + +# +# Wireless Coexistence +# +# CONFIG_ESP_COEX_EXTERNAL_COEXIST_ENABLE is not set +# end of Wireless Coexistence + +# +# Common ESP-related +# +CONFIG_ESP_ERR_TO_NAME_LOOKUP=y +# end of Common ESP-related + +# +# Ethernet +# +CONFIG_ETH_ENABLED=y +CONFIG_ETH_USE_SPI_ETHERNET=y +# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set +# CONFIG_ETH_SPI_ETHERNET_W5500 is not set +# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set +# CONFIG_ETH_USE_OPENETH is not set +# CONFIG_ETH_TRANSMIT_MUTEX is not set +# end of Ethernet + +# +# Event Loop Library +# +# CONFIG_ESP_EVENT_LOOP_PROFILING is not set +CONFIG_ESP_EVENT_POST_FROM_ISR=y +CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR=y +# end of Event Loop Library + +# +# GDB Stub +# +# end of GDB Stub + +# +# ESP HTTP client +# +CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y +# CONFIG_ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH is not set +# CONFIG_ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH is not set +# end of ESP HTTP client + +# +# HTTP Server +# +CONFIG_HTTPD_MAX_REQ_HDR_LEN=512 +CONFIG_HTTPD_MAX_URI_LEN=512 +CONFIG_HTTPD_ERR_RESP_NO_DELAY=y +CONFIG_HTTPD_PURGE_BUF_LEN=32 +# CONFIG_HTTPD_LOG_PURGE_DATA is not set +# CONFIG_HTTPD_WS_SUPPORT is not set +# CONFIG_HTTPD_QUEUE_WORK_BLOCKING is not set +# end of HTTP Server + +# +# ESP HTTPS OTA +# +# CONFIG_ESP_HTTPS_OTA_DECRYPT_CB is not set +# CONFIG_ESP_HTTPS_OTA_ALLOW_HTTP is not set +# end of ESP HTTPS OTA + +# +# ESP HTTPS server +# +# CONFIG_ESP_HTTPS_SERVER_ENABLE is not set +# end of ESP HTTPS server + +# +# Hardware Settings +# + +# +# Chip revision +# +CONFIG_ESP32S3_REV_MIN_0=y +# CONFIG_ESP32S3_REV_MIN_1 is not set +# CONFIG_ESP32S3_REV_MIN_2 is not set +CONFIG_ESP32S3_REV_MIN_FULL=0 +CONFIG_ESP_REV_MIN_FULL=0 + +# +# Maximum Supported ESP32-S3 Revision (Rev v0.99) +# +CONFIG_ESP32S3_REV_MAX_FULL=99 +CONFIG_ESP_REV_MAX_FULL=99 +# end of Chip revision + +# +# MAC Config +# +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_STA=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_WIFI_AP=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_BT=y +CONFIG_ESP_MAC_ADDR_UNIVERSE_ETH=y +CONFIG_ESP_MAC_UNIVERSAL_MAC_ADDRESSES_FOUR=y +# CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_TWO is not set +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES_FOUR=y +CONFIG_ESP32S3_UNIVERSAL_MAC_ADDRESSES=4 +# end of MAC Config + +# +# Sleep Config +# +CONFIG_ESP_SLEEP_FLASH_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_PSRAM_LEAKAGE_WORKAROUND=y +CONFIG_ESP_SLEEP_MSPI_NEED_ALL_IO_PU=y +CONFIG_ESP_SLEEP_RTC_BUS_ISO_WORKAROUND=y +CONFIG_ESP_SLEEP_GPIO_RESET_WORKAROUND=y +CONFIG_ESP_SLEEP_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP_SLEEP_GPIO_ENABLE_INTERNAL_RESISTORS=y +# end of Sleep Config + +# +# RTC Clock Config +# +CONFIG_RTC_CLK_SRC_INT_RC=y +# CONFIG_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_RTC_CLK_CAL_CYCLES=1024 +# end of RTC Clock Config + +# +# Peripheral Control +# +CONFIG_PERIPH_CTRL_FUNC_IN_IRAM=y +# end of Peripheral Control + +# +# GDMA Configuration +# +# CONFIG_GDMA_CTRL_FUNC_IN_IRAM is not set +# CONFIG_GDMA_ISR_IRAM_SAFE is not set +# end of GDMA Configuration + +# +# Main XTAL Config +# +CONFIG_XTAL_FREQ_40=y +CONFIG_XTAL_FREQ=40 +# end of Main XTAL Config +# end of Hardware Settings + +# +# LCD and Touch Panel +# + +# +# LCD Touch Drivers are maintained in the IDF Component Registry +# + +# +# LCD Peripheral Configuration +# +CONFIG_LCD_PANEL_IO_FORMAT_BUF_SIZE=32 +# CONFIG_LCD_ENABLE_DEBUG_LOG is not set +# CONFIG_LCD_RGB_ISR_IRAM_SAFE is not set +# CONFIG_LCD_RGB_RESTART_IN_VSYNC is not set +# end of LCD Peripheral Configuration +# end of LCD and Touch Panel + +# +# ESP NETIF Adapter +# +CONFIG_ESP_NETIF_IP_LOST_TIMER_INTERVAL=120 +CONFIG_ESP_NETIF_TCPIP_LWIP=y +# CONFIG_ESP_NETIF_LOOPBACK is not set +CONFIG_ESP_NETIF_USES_TCPIP_WITH_BSD_API=y +# CONFIG_ESP_NETIF_RECEIVE_REPORT_ERRORS is not set +# CONFIG_ESP_NETIF_L2_TAP is not set +# CONFIG_ESP_NETIF_BRIDGE_EN is not set +# end of ESP NETIF Adapter + +# +# Partition API Configuration +# +# end of Partition API Configuration + +# +# PHY +# +CONFIG_ESP_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP_PHY_MAX_TX_POWER=20 +# CONFIG_ESP_PHY_REDUCE_TX_POWER is not set +CONFIG_ESP_PHY_ENABLE_USB=y +# CONFIG_ESP_PHY_ENABLE_CERT_TEST is not set +CONFIG_ESP_PHY_RF_CAL_PARTIAL=y +# CONFIG_ESP_PHY_RF_CAL_NONE is not set +# CONFIG_ESP_PHY_RF_CAL_FULL is not set +CONFIG_ESP_PHY_CALIBRATION_MODE=0 +# end of PHY + +# +# Power Management +# +# CONFIG_PM_ENABLE is not set +CONFIG_PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP=y +CONFIG_PM_POWER_DOWN_TAGMEM_IN_LIGHT_SLEEP=y +# end of Power Management + +# +# ESP PSRAM +# +CONFIG_SPIRAM=y + +# +# SPI RAM config +# +# CONFIG_SPIRAM_MODE_QUAD is not set +CONFIG_SPIRAM_MODE_OCT=y +CONFIG_SPIRAM_TYPE_AUTO=y +# CONFIG_SPIRAM_TYPE_ESPPSRAM64 is not set +# CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY is not set +CONFIG_SPIRAM_CLK_IO=30 +CONFIG_SPIRAM_CS_IO=26 +CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y +CONFIG_SPIRAM_RODATA=y +CONFIG_SPIRAM_SPEED_80M=y +# CONFIG_SPIRAM_SPEED_40M is not set +CONFIG_SPIRAM_SPEED=80 +CONFIG_SPIRAM_BOOT_INIT=y +# CONFIG_SPIRAM_IGNORE_NOTFOUND is not set +# CONFIG_SPIRAM_USE_MEMMAP is not set +# CONFIG_SPIRAM_USE_CAPS_ALLOC is not set +CONFIG_SPIRAM_USE_MALLOC=y +CONFIG_SPIRAM_MEMTEST=y +CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=16384 +# CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP is not set +CONFIG_SPIRAM_MALLOC_RESERVE_INTERNAL=32768 +# CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY is not set +# CONFIG_SPIRAM_ECC_ENABLE is not set +# end of SPI RAM config +# end of ESP PSRAM + +# +# ESP Ringbuf +# +# CONFIG_RINGBUF_PLACE_FUNCTIONS_INTO_FLASH is not set +# end of ESP Ringbuf + +# +# ESP System Settings +# +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_80 is not set +# CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_160 is not set +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=240 + +# +# Cache config +# +CONFIG_ESP32S3_INSTRUCTION_CACHE_16KB=y +# CONFIG_ESP32S3_INSTRUCTION_CACHE_32KB is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_SIZE=0x4000 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_4WAYS is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_8WAYS=y +CONFIG_ESP32S3_ICACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_16B is not set +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_32B=y +CONFIG_ESP32S3_INSTRUCTION_CACHE_LINE_SIZE=32 +# CONFIG_ESP32S3_DATA_CACHE_16KB is not set +CONFIG_ESP32S3_DATA_CACHE_32KB=y +# CONFIG_ESP32S3_DATA_CACHE_64KB is not set +CONFIG_ESP32S3_DATA_CACHE_SIZE=0x8000 +# CONFIG_ESP32S3_DATA_CACHE_4WAYS is not set +CONFIG_ESP32S3_DATA_CACHE_8WAYS=y +CONFIG_ESP32S3_DCACHE_ASSOCIATED_WAYS=8 +# CONFIG_ESP32S3_DATA_CACHE_LINE_16B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_32B=y +# CONFIG_ESP32S3_DATA_CACHE_LINE_64B is not set +CONFIG_ESP32S3_DATA_CACHE_LINE_SIZE=32 +# end of Cache config + +# +# Memory +# +# CONFIG_ESP32S3_RTCDATA_IN_FAST_MEM is not set +# CONFIG_ESP32S3_USE_FIXED_STATIC_RAM_SIZE is not set +# end of Memory + +# +# Trace memory +# +# CONFIG_ESP32S3_TRAX is not set +CONFIG_ESP32S3_TRACEMEM_RESERVE_DRAM=0x0 +# end of Trace memory + +# CONFIG_ESP_SYSTEM_PANIC_PRINT_HALT is not set +CONFIG_ESP_SYSTEM_PANIC_PRINT_REBOOT=y +# CONFIG_ESP_SYSTEM_PANIC_SILENT_REBOOT is not set +# CONFIG_ESP_SYSTEM_PANIC_GDBSTUB is not set +# CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME is not set +CONFIG_ESP_SYSTEM_PANIC_REBOOT_DELAY_SECONDS=0 +CONFIG_ESP_SYSTEM_RTC_FAST_MEM_AS_HEAP_DEPCHECK=y +CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP=y + +# +# Memory protection +# +CONFIG_ESP_SYSTEM_MEMPROT_FEATURE=y +CONFIG_ESP_SYSTEM_MEMPROT_FEATURE_LOCK=y +# end of Memory protection + +CONFIG_ESP_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_ESP_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_ESP_MAIN_TASK_STACK_SIZE=3584 +CONFIG_ESP_MAIN_TASK_AFFINITY_CPU0=y +# CONFIG_ESP_MAIN_TASK_AFFINITY_CPU1 is not set +# CONFIG_ESP_MAIN_TASK_AFFINITY_NO_AFFINITY is not set +CONFIG_ESP_MAIN_TASK_AFFINITY=0x0 +CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE=2048 +CONFIG_ESP_CONSOLE_UART_DEFAULT=y +# CONFIG_ESP_CONSOLE_USB_CDC is not set +# CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG is not set +# CONFIG_ESP_CONSOLE_UART_CUSTOM is not set +# CONFIG_ESP_CONSOLE_NONE is not set +# CONFIG_ESP_CONSOLE_SECONDARY_NONE is not set +CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG=y +CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG_ENABLED=y +CONFIG_ESP_CONSOLE_UART=y +CONFIG_ESP_CONSOLE_MULTIPLE_UART=y +CONFIG_ESP_CONSOLE_UART_NUM=0 +CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 +CONFIG_ESP_INT_WDT=y +CONFIG_ESP_INT_WDT_TIMEOUT_MS=300 +CONFIG_ESP_INT_WDT_CHECK_CPU1=y +CONFIG_ESP_TASK_WDT_EN=y +CONFIG_ESP_TASK_WDT_INIT=y +# CONFIG_ESP_TASK_WDT_PANIC is not set +CONFIG_ESP_TASK_WDT_TIMEOUT_S=5 +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP_PANIC_HANDLER_IRAM is not set +# CONFIG_ESP_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP_DEBUG_OCDAWARE=y +CONFIG_ESP_SYSTEM_CHECK_INT_LEVEL_4=y + +# +# Brownout Detector +# +CONFIG_ESP_BROWNOUT_DET=y +CONFIG_ESP_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP_BROWNOUT_DET_LVL_SEL_1 is not set +CONFIG_ESP_BROWNOUT_DET_LVL=7 +# end of Brownout Detector + +CONFIG_ESP_SYSTEM_BROWNOUT_INTR=y +# end of ESP System Settings + +# +# IPC (Inter-Processor Call) +# +CONFIG_ESP_IPC_TASK_STACK_SIZE=1280 +CONFIG_ESP_IPC_USES_CALLERS_PRIORITY=y +CONFIG_ESP_IPC_ISR_ENABLE=y +# end of IPC (Inter-Processor Call) + +# +# High resolution timer (esp_timer) +# +# CONFIG_ESP_TIMER_PROFILING is not set +CONFIG_ESP_TIME_FUNCS_USE_RTC_TIMER=y +CONFIG_ESP_TIME_FUNCS_USE_ESP_TIMER=y +CONFIG_ESP_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP_TIMER_INTERRUPT_LEVEL=1 +# CONFIG_ESP_TIMER_SHOW_EXPERIMENTAL is not set +CONFIG_ESP_TIMER_TASK_AFFINITY=0x0 +CONFIG_ESP_TIMER_TASK_AFFINITY_CPU0=y +CONFIG_ESP_TIMER_ISR_AFFINITY=0x1 +CONFIG_ESP_TIMER_ISR_AFFINITY_CPU0=y +# CONFIG_ESP_TIMER_SUPPORTS_ISR_DISPATCH_METHOD is not set +CONFIG_ESP_TIMER_IMPL_SYSTIMER=y +# end of High resolution timer (esp_timer) + +# +# Wi-Fi +# +CONFIG_ESP_WIFI_ENABLED=y +CONFIG_ESP_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER=y +CONFIG_ESP_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP_WIFI_STATIC_TX_BUFFER_NUM=16 +CONFIG_ESP_WIFI_CACHE_TX_BUFFER_NUM=32 +CONFIG_ESP_WIFI_STATIC_RX_MGMT_BUFFER=y +# CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUFFER is not set +CONFIG_ESP_WIFI_DYNAMIC_RX_MGMT_BUF=0 +CONFIG_ESP_WIFI_RX_MGMT_BUF_NUM_DEF=5 +# CONFIG_ESP_WIFI_CSI_ENABLED is not set +CONFIG_ESP_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP_WIFI_TX_BA_WIN=6 +CONFIG_ESP_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP_WIFI_RX_BA_WIN=6 +# CONFIG_ESP_WIFI_AMSDU_TX_ENABLED is not set +CONFIG_ESP_WIFI_NVS_ENABLED=y +CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP_WIFI_IRAM_OPT=y +# CONFIG_ESP_WIFI_EXTRA_IRAM_OPT is not set +CONFIG_ESP_WIFI_RX_IRAM_OPT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP_WIFI_ENABLE_SAE_PK=y +CONFIG_ESP_WIFI_SOFTAP_SAE_SUPPORT=y +CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y +# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set +# CONFIG_ESP_WIFI_FTM_ENABLE is not set +CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE=y +# CONFIG_ESP_WIFI_GCMP_SUPPORT is not set +# CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y +# CONFIG_ESP_WIFI_SLP_BEACON_LOST_OPT is not set +CONFIG_ESP_WIFI_ESPNOW_MAX_ENCRYPT_NUM=7 +CONFIG_ESP_WIFI_MBEDTLS_CRYPTO=y +CONFIG_ESP_WIFI_MBEDTLS_TLS_CLIENT=y +# CONFIG_ESP_WIFI_WAPI_PSK is not set +# CONFIG_ESP_WIFI_SUITE_B_192 is not set +# CONFIG_ESP_WIFI_11KV_SUPPORT is not set +# CONFIG_ESP_WIFI_MBO_SUPPORT is not set +# CONFIG_ESP_WIFI_DPP_SUPPORT is not set +# CONFIG_ESP_WIFI_11R_SUPPORT is not set +# CONFIG_ESP_WIFI_WPS_SOFTAP_REGISTRAR is not set + +# +# WPS Configuration Options +# +# CONFIG_ESP_WIFI_WPS_STRICT is not set +# CONFIG_ESP_WIFI_WPS_PASSPHRASE is not set +# end of WPS Configuration Options + +# CONFIG_ESP_WIFI_DEBUG_PRINT is not set +# CONFIG_ESP_WIFI_TESTING_OPTIONS is not set +CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y +# end of Wi-Fi + +# +# Core dump +# +# CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH is not set +# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set +CONFIG_ESP_COREDUMP_ENABLE_TO_NONE=y +# end of Core dump + +# +# FAT Filesystem support +# +CONFIG_FATFS_VOLUME_COUNT=2 +CONFIG_FATFS_LFN_NONE=y +# CONFIG_FATFS_LFN_HEAP is not set +# CONFIG_FATFS_LFN_STACK is not set +# CONFIG_FATFS_SECTOR_512 is not set +CONFIG_FATFS_SECTOR_4096=y +# CONFIG_FATFS_CODEPAGE_DYNAMIC is not set +CONFIG_FATFS_CODEPAGE_437=y +# CONFIG_FATFS_CODEPAGE_720 is not set +# CONFIG_FATFS_CODEPAGE_737 is not set +# CONFIG_FATFS_CODEPAGE_771 is not set +# CONFIG_FATFS_CODEPAGE_775 is not set +# CONFIG_FATFS_CODEPAGE_850 is not set +# CONFIG_FATFS_CODEPAGE_852 is not set +# CONFIG_FATFS_CODEPAGE_855 is not set +# CONFIG_FATFS_CODEPAGE_857 is not set +# CONFIG_FATFS_CODEPAGE_860 is not set +# CONFIG_FATFS_CODEPAGE_861 is not set +# CONFIG_FATFS_CODEPAGE_862 is not set +# CONFIG_FATFS_CODEPAGE_863 is not set +# CONFIG_FATFS_CODEPAGE_864 is not set +# CONFIG_FATFS_CODEPAGE_865 is not set +# CONFIG_FATFS_CODEPAGE_866 is not set +# CONFIG_FATFS_CODEPAGE_869 is not set +# CONFIG_FATFS_CODEPAGE_932 is not set +# CONFIG_FATFS_CODEPAGE_936 is not set +# CONFIG_FATFS_CODEPAGE_949 is not set +# CONFIG_FATFS_CODEPAGE_950 is not set +CONFIG_FATFS_CODEPAGE=437 +CONFIG_FATFS_FS_LOCK=0 +CONFIG_FATFS_TIMEOUT_MS=10000 +CONFIG_FATFS_PER_FILE_CACHE=y +CONFIG_FATFS_ALLOC_PREFER_EXTRAM=y +# CONFIG_FATFS_USE_FASTSEEK is not set +CONFIG_FATFS_VFS_FSTAT_BLKSIZE=0 +# end of FAT Filesystem support + +# +# FreeRTOS +# + +# +# Kernel +# +# CONFIG_FREERTOS_SMP is not set +# CONFIG_FREERTOS_UNICORE is not set +CONFIG_FREERTOS_HZ=100 +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE is not set +# CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL is not set +CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y +CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1 +CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536 +# CONFIG_FREERTOS_USE_IDLE_HOOK is not set +# CONFIG_FREERTOS_USE_TICK_HOOK is not set +CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16 +# CONFIG_FREERTOS_ENABLE_BACKWARD_COMPATIBILITY is not set +CONFIG_FREERTOS_TIMER_TASK_PRIORITY=1 +CONFIG_FREERTOS_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_FREERTOS_TIMER_QUEUE_LENGTH=10 +CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0 +CONFIG_FREERTOS_TASK_NOTIFICATION_ARRAY_ENTRIES=1 +# CONFIG_FREERTOS_USE_TRACE_FACILITY is not set +# CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS is not set +# end of Kernel + +# +# Port +# +CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y +# CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK is not set +CONFIG_FREERTOS_TLSP_DELETION_CALLBACKS=y +# CONFIG_FREERTOS_ENABLE_STATIC_TASK_CLEAN_UP is not set +CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y +CONFIG_FREERTOS_ISR_STACKSIZE=1536 +CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y +CONFIG_FREERTOS_TICK_SUPPORT_SYSTIMER=y +CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL1=y +# CONFIG_FREERTOS_CORETIMER_SYSTIMER_LVL3 is not set +CONFIG_FREERTOS_SYSTICK_USES_SYSTIMER=y +# CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set +# CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set +# CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set +CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y +# end of Port + +CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF +CONFIG_FREERTOS_SUPPORT_STATIC_ALLOCATION=y +CONFIG_FREERTOS_DEBUG_OCDAWARE=y +# end of FreeRTOS + +# +# Hardware Abstraction Layer (HAL) and Low Level (LL) +# +CONFIG_HAL_ASSERTION_EQUALS_SYSTEM=y +# CONFIG_HAL_ASSERTION_DISABLE is not set +# CONFIG_HAL_ASSERTION_SILENT is not set +# CONFIG_HAL_ASSERTION_ENABLE is not set +CONFIG_HAL_DEFAULT_ASSERTION_LEVEL=2 +CONFIG_HAL_WDT_USE_ROM_IMPL=y +CONFIG_HAL_SPI_MASTER_FUNC_IN_IRAM=y +CONFIG_HAL_SPI_SLAVE_FUNC_IN_IRAM=y +# end of Hardware Abstraction Layer (HAL) and Low Level (LL) + +# +# Heap memory debugging +# +CONFIG_HEAP_POISONING_DISABLED=y +# CONFIG_HEAP_POISONING_LIGHT is not set +# CONFIG_HEAP_POISONING_COMPREHENSIVE is not set +CONFIG_HEAP_TRACING_OFF=y +# CONFIG_HEAP_TRACING_STANDALONE is not set +# CONFIG_HEAP_TRACING_TOHOST is not set +# CONFIG_HEAP_USE_HOOKS is not set +# CONFIG_HEAP_ABORT_WHEN_ALLOCATION_FAILS is not set +# CONFIG_HEAP_PLACE_FUNCTION_INTO_FLASH is not set +# end of Heap memory debugging + +CONFIG_IEEE802154_CCA_THRESHOLD=-60 +CONFIG_IEEE802154_PENDING_TABLE_SIZE=20 + +# +# Log output +# +# CONFIG_LOG_DEFAULT_LEVEL_NONE is not set +# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set +# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set +CONFIG_LOG_DEFAULT_LEVEL_INFO=y +# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set +# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set +CONFIG_LOG_DEFAULT_LEVEL=3 +CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y +# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set +# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set +CONFIG_LOG_MAXIMUM_LEVEL=3 +CONFIG_LOG_COLORS=y +CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y +# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set +# end of Log output + +# +# LWIP +# +CONFIG_LWIP_LOCAL_HOSTNAME="espressif" +# CONFIG_LWIP_NETIF_API is not set +CONFIG_LWIP_TCPIP_TASK_PRIO=18 +# CONFIG_LWIP_TCPIP_CORE_LOCKING is not set +# CONFIG_LWIP_CHECK_THREAD_SAFETY is not set +CONFIG_LWIP_DNS_SUPPORT_MDNS_QUERIES=y +# CONFIG_LWIP_L2_TO_L3_COPY is not set +# CONFIG_LWIP_IRAM_OPTIMIZATION is not set +# CONFIG_LWIP_EXTRA_IRAM_OPTIMIZATION is not set +CONFIG_LWIP_TIMERS_ONDEMAND=y +CONFIG_LWIP_ND6=y +CONFIG_LWIP_MAX_SOCKETS=10 +# CONFIG_LWIP_USE_ONLY_LWIP_SELECT is not set +# CONFIG_LWIP_SO_LINGER is not set +CONFIG_LWIP_SO_REUSE=y +CONFIG_LWIP_SO_REUSE_RXTOALL=y +# CONFIG_LWIP_SO_RCVBUF is not set +# CONFIG_LWIP_NETBUF_RECVINFO is not set +CONFIG_LWIP_IP4_FRAG=y +CONFIG_LWIP_IP6_FRAG=y +# CONFIG_LWIP_IP4_REASSEMBLY is not set +# CONFIG_LWIP_IP6_REASSEMBLY is not set +CONFIG_LWIP_IP_REASS_MAX_PBUFS=10 +# CONFIG_LWIP_IP_FORWARD is not set +# CONFIG_LWIP_STATS is not set +CONFIG_LWIP_ESP_GRATUITOUS_ARP=y +CONFIG_LWIP_GARP_TMR_INTERVAL=60 +CONFIG_LWIP_ESP_MLDV6_REPORT=y +CONFIG_LWIP_MLDV6_TMR_INTERVAL=40 +CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 +CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y +# CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y +# CONFIG_LWIP_DHCP_RESTORE_LAST_IP is not set +CONFIG_LWIP_DHCP_OPTIONS_LEN=68 +CONFIG_LWIP_NUM_NETIF_CLIENT_DATA=0 +CONFIG_LWIP_DHCP_COARSE_TIMER_SECS=1 + +# +# DHCP server +# +CONFIG_LWIP_DHCPS=y +CONFIG_LWIP_DHCPS_LEASE_UNIT=60 +CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8 +# end of DHCP server + +# CONFIG_LWIP_AUTOIP is not set +CONFIG_LWIP_IPV4=y +CONFIG_LWIP_IPV6=y +# CONFIG_LWIP_IPV6_AUTOCONFIG is not set +CONFIG_LWIP_IPV6_NUM_ADDRESSES=3 +# CONFIG_LWIP_IPV6_FORWARD is not set +# CONFIG_LWIP_NETIF_STATUS_CALLBACK is not set +CONFIG_LWIP_NETIF_LOOPBACK=y +CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8 + +# +# TCP +# +CONFIG_LWIP_MAX_ACTIVE_TCP=16 +CONFIG_LWIP_MAX_LISTENING_TCP=16 +CONFIG_LWIP_TCP_HIGH_SPEED_RETRANSMISSION=y +CONFIG_LWIP_TCP_MAXRTX=12 +CONFIG_LWIP_TCP_SYNMAXRTX=12 +CONFIG_LWIP_TCP_MSS=1440 +CONFIG_LWIP_TCP_TMR_INTERVAL=250 +CONFIG_LWIP_TCP_MSL=60000 +CONFIG_LWIP_TCP_FIN_WAIT_TIMEOUT=20000 +CONFIG_LWIP_TCP_SND_BUF_DEFAULT=5744 +CONFIG_LWIP_TCP_WND_DEFAULT=5744 +CONFIG_LWIP_TCP_RECVMBOX_SIZE=6 +CONFIG_LWIP_TCP_QUEUE_OOSEQ=y +# CONFIG_LWIP_TCP_SACK_OUT is not set +CONFIG_LWIP_TCP_OVERSIZE_MSS=y +# CONFIG_LWIP_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_LWIP_TCP_OVERSIZE_DISABLE is not set +CONFIG_LWIP_TCP_RTO_TIME=1500 +# end of TCP + +# +# UDP +# +CONFIG_LWIP_MAX_UDP_PCBS=16 +CONFIG_LWIP_UDP_RECVMBOX_SIZE=6 +# end of UDP + +# +# Checksums +# +# CONFIG_LWIP_CHECKSUM_CHECK_IP is not set +# CONFIG_LWIP_CHECKSUM_CHECK_UDP is not set +CONFIG_LWIP_CHECKSUM_CHECK_ICMP=y +# end of Checksums + +CONFIG_LWIP_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_LWIP_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_LWIP_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_LWIP_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_LWIP_PPP_SUPPORT is not set +CONFIG_LWIP_IPV6_MEMP_NUM_ND6_QUEUE=3 +CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS=5 +# CONFIG_LWIP_SLIP_SUPPORT is not set + +# +# ICMP +# +CONFIG_LWIP_ICMP=y +# CONFIG_LWIP_MULTICAST_PING is not set +# CONFIG_LWIP_BROADCAST_PING is not set +# end of ICMP + +# +# LWIP RAW API +# +CONFIG_LWIP_MAX_RAW_PCBS=16 +# end of LWIP RAW API + +# +# SNTP +# +CONFIG_LWIP_SNTP_MAX_SERVERS=1 +# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 +# end of SNTP + +CONFIG_LWIP_BRIDGEIF_MAX_PORTS=7 +CONFIG_LWIP_ESP_LWIP_ASSERT=y + +# +# Hooks +# +# CONFIG_LWIP_HOOK_TCP_ISN_NONE is not set +CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT=y +# CONFIG_LWIP_HOOK_TCP_ISN_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_ROUTE_NONE=y +# CONFIG_LWIP_HOOK_IP6_ROUTE_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_ROUTE_CUSTOM is not set +CONFIG_LWIP_HOOK_ND6_GET_GW_NONE=y +# CONFIG_LWIP_HOOK_ND6_GET_GW_DEFAULT is not set +# CONFIG_LWIP_HOOK_ND6_GET_GW_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_NONE=y +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_SELECT_SRC_ADDR_CUSTOM is not set +CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_NONE=y +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_DEFAULT is not set +# CONFIG_LWIP_HOOK_NETCONN_EXT_RESOLVE_CUSTOM is not set +CONFIG_LWIP_HOOK_IP6_INPUT_NONE=y +# CONFIG_LWIP_HOOK_IP6_INPUT_DEFAULT is not set +# CONFIG_LWIP_HOOK_IP6_INPUT_CUSTOM is not set +# end of Hooks + +# CONFIG_LWIP_DEBUG is not set +# end of LWIP + +# +# mbedTLS +# +CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y +# CONFIG_MBEDTLS_EXTERNAL_MEM_ALLOC is not set +# CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC is not set +# CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC is not set +CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=y +CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN=16384 +CONFIG_MBEDTLS_SSL_OUT_CONTENT_LEN=4096 +# CONFIG_MBEDTLS_DYNAMIC_BUFFER is not set +# CONFIG_MBEDTLS_DEBUG is not set + +# +# mbedTLS v3.x related +# +# CONFIG_MBEDTLS_SSL_PROTO_TLS1_3 is not set +# CONFIG_MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH is not set +# CONFIG_MBEDTLS_X509_TRUSTED_CERT_CALLBACK is not set +# CONFIG_MBEDTLS_SSL_CONTEXT_SERIALIZATION is not set +CONFIG_MBEDTLS_SSL_KEEP_PEER_CERTIFICATE=y +CONFIG_MBEDTLS_PKCS7_C=y +# end of mbedTLS v3.x related + +# +# Certificate Bundle +# +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=y +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=y +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_CMN is not set +# CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_NONE is not set +# CONFIG_MBEDTLS_CUSTOM_CERTIFICATE_BUNDLE is not set +CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_MAX_CERTS=200 +# end of Certificate Bundle + +# CONFIG_MBEDTLS_ECP_RESTARTABLE is not set +CONFIG_MBEDTLS_CMAC_C=y +CONFIG_MBEDTLS_HARDWARE_AES=y +CONFIG_MBEDTLS_AES_USE_INTERRUPT=y +CONFIG_MBEDTLS_HARDWARE_MPI=y +CONFIG_MBEDTLS_MPI_USE_INTERRUPT=y +CONFIG_MBEDTLS_HARDWARE_SHA=y +CONFIG_MBEDTLS_ROM_MD5=y +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_SIGN is not set +# CONFIG_MBEDTLS_ATCA_HW_ECDSA_VERIFY is not set +CONFIG_MBEDTLS_HAVE_TIME=y +# CONFIG_MBEDTLS_PLATFORM_TIME_ALT is not set +# CONFIG_MBEDTLS_HAVE_TIME_DATE is not set +CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y +CONFIG_MBEDTLS_SHA512_C=y +CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y +# CONFIG_MBEDTLS_TLS_SERVER_ONLY is not set +# CONFIG_MBEDTLS_TLS_CLIENT_ONLY is not set +# CONFIG_MBEDTLS_TLS_DISABLED is not set +CONFIG_MBEDTLS_TLS_SERVER=y +CONFIG_MBEDTLS_TLS_CLIENT=y +CONFIG_MBEDTLS_TLS_ENABLED=y + +# +# TLS Key Exchange Methods +# +# CONFIG_MBEDTLS_PSK_MODES is not set +CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y +CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y +# end of TLS Key Exchange Methods + +CONFIG_MBEDTLS_SSL_RENEGOTIATION=y +CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y +# CONFIG_MBEDTLS_SSL_PROTO_GMTSSL1_1 is not set +# CONFIG_MBEDTLS_SSL_PROTO_DTLS is not set +CONFIG_MBEDTLS_SSL_ALPN=y +CONFIG_MBEDTLS_CLIENT_SSL_SESSION_TICKETS=y +CONFIG_MBEDTLS_SERVER_SSL_SESSION_TICKETS=y + +# +# Symmetric Ciphers +# +CONFIG_MBEDTLS_AES_C=y +# CONFIG_MBEDTLS_CAMELLIA_C is not set +# CONFIG_MBEDTLS_DES_C is not set +# CONFIG_MBEDTLS_BLOWFISH_C is not set +# CONFIG_MBEDTLS_XTEA_C is not set +CONFIG_MBEDTLS_CCM_C=y +CONFIG_MBEDTLS_GCM_C=y +# CONFIG_MBEDTLS_NIST_KW_C is not set +# end of Symmetric Ciphers + +# CONFIG_MBEDTLS_RIPEMD160_C is not set + +# +# Certificates +# +CONFIG_MBEDTLS_PEM_PARSE_C=y +CONFIG_MBEDTLS_PEM_WRITE_C=y +CONFIG_MBEDTLS_X509_CRL_PARSE_C=y +CONFIG_MBEDTLS_X509_CSR_PARSE_C=y +# end of Certificates + +CONFIG_MBEDTLS_ECP_C=y +# CONFIG_MBEDTLS_DHM_C is not set +CONFIG_MBEDTLS_ECDH_C=y +CONFIG_MBEDTLS_ECDSA_C=y +# CONFIG_MBEDTLS_ECJPAKE_C is not set +CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y +CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y +CONFIG_MBEDTLS_ECP_NIST_OPTIM=y +CONFIG_MBEDTLS_ECP_FIXED_POINT_OPTIM=y +# CONFIG_MBEDTLS_POLY1305_C is not set +# CONFIG_MBEDTLS_CHACHA20_C is not set +# CONFIG_MBEDTLS_HKDF_C is not set +# CONFIG_MBEDTLS_THREADING_C is not set +# CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI is not set +# end of mbedTLS + +# +# ESP-MQTT Configurations +# +CONFIG_MQTT_PROTOCOL_311=y +# CONFIG_MQTT_PROTOCOL_5 is not set +CONFIG_MQTT_TRANSPORT_SSL=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET=y +CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y +# CONFIG_MQTT_MSG_ID_INCREMENTAL is not set +# CONFIG_MQTT_SKIP_PUBLISH_IF_DISCONNECTED is not set +# CONFIG_MQTT_REPORT_DELETED_MESSAGES is not set +# CONFIG_MQTT_USE_CUSTOM_CONFIG is not set +# CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED is not set +# CONFIG_MQTT_CUSTOM_OUTBOX is not set +# end of ESP-MQTT Configurations + +# +# Newlib +# +CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF is not set +# CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF is not set +# CONFIG_NEWLIB_STDIN_LINE_ENDING_LF is not set +CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y +# CONFIG_NEWLIB_NANO_FORMAT is not set +CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC_HRT=y +# CONFIG_NEWLIB_TIME_SYSCALL_USE_RTC is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_HRT is not set +# CONFIG_NEWLIB_TIME_SYSCALL_USE_NONE is not set +# end of Newlib + +# +# NVS +# +# CONFIG_NVS_ASSERT_ERROR_CHECK is not set +# end of NVS + +# +# OpenThread +# +# CONFIG_OPENTHREAD_ENABLED is not set + +# +# Thread Operational Dataset +# +CONFIG_OPENTHREAD_NETWORK_NAME="OpenThread-ESP" +CONFIG_OPENTHREAD_MESH_LOCAL_PREFIX="fd00:db8:a0:0::/64" +CONFIG_OPENTHREAD_NETWORK_CHANNEL=15 +CONFIG_OPENTHREAD_NETWORK_PANID=0x1234 +CONFIG_OPENTHREAD_NETWORK_EXTPANID="dead00beef00cafe" +CONFIG_OPENTHREAD_NETWORK_MASTERKEY="00112233445566778899aabbccddeeff" +CONFIG_OPENTHREAD_NETWORK_PSKC="104810e2315100afd6bc9215a6bfac53" +# end of Thread Operational Dataset + +CONFIG_OPENTHREAD_XTAL_ACCURACY=130 +# end of OpenThread + +# +# Protocomm +# +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_0=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_1=y +CONFIG_ESP_PROTOCOMM_SUPPORT_SECURITY_VERSION_2=y +# end of Protocomm + +# +# PThreads +# +CONFIG_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_PTHREAD_STACK_MIN=768 +CONFIG_PTHREAD_DEFAULT_CORE_NO_AFFINITY=y +# CONFIG_PTHREAD_DEFAULT_CORE_0 is not set +# CONFIG_PTHREAD_DEFAULT_CORE_1 is not set +CONFIG_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_PTHREAD_TASK_NAME_DEFAULT="pthread" +# end of PThreads + +# +# MMU Config +# +CONFIG_MMU_PAGE_SIZE_64KB=y +CONFIG_MMU_PAGE_MODE="64KB" +CONFIG_MMU_PAGE_SIZE=0x10000 +# end of MMU Config + +# +# SPI Flash driver +# +# CONFIG_SPI_FLASH_VERIFY_WRITE is not set +# CONFIG_SPI_FLASH_ENABLE_COUNTERS is not set +CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y +# CONFIG_SPI_FLASH_ROM_IMPL is not set +CONFIG_SPI_FLASH_DANGEROUS_WRITE_ABORTS=y +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_FAILS is not set +# CONFIG_SPI_FLASH_DANGEROUS_WRITE_ALLOWED is not set +# CONFIG_SPI_FLASH_BYPASS_BLOCK_ERASE is not set +CONFIG_SPI_FLASH_YIELD_DURING_ERASE=y +CONFIG_SPI_FLASH_ERASE_YIELD_DURATION_MS=20 +CONFIG_SPI_FLASH_ERASE_YIELD_TICKS=1 +CONFIG_SPI_FLASH_WRITE_CHUNK_SIZE=8192 +# CONFIG_SPI_FLASH_SIZE_OVERRIDE is not set +# CONFIG_SPI_FLASH_CHECK_ERASE_TIMEOUT_DISABLED is not set +# CONFIG_SPI_FLASH_OVERRIDE_CHIP_DRIVER_LIST is not set + +# +# SPI Flash behavior when brownout +# +CONFIG_SPI_FLASH_BROWNOUT_RESET_XMC=y +CONFIG_SPI_FLASH_BROWNOUT_RESET=y +# end of SPI Flash behavior when brownout + +# +# Auto-detect flash chips +# +CONFIG_SPI_FLASH_VENDOR_XMC_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_GD_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_ISSI_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_MXIC_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_WINBOND_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_BOYA_SUPPORTED=y +CONFIG_SPI_FLASH_VENDOR_TH_SUPPORTED=y +CONFIG_SPI_FLASH_SUPPORT_ISSI_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_GD_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_WINBOND_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_BOYA_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_TH_CHIP=y +CONFIG_SPI_FLASH_SUPPORT_MXIC_OPI_CHIP=y +# end of Auto-detect flash chips + +CONFIG_SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE=y +# end of SPI Flash driver + +# +# SPIFFS Configuration +# +CONFIG_SPIFFS_MAX_PARTITIONS=3 + +# +# SPIFFS Cache Configuration +# +CONFIG_SPIFFS_CACHE=y +CONFIG_SPIFFS_CACHE_WR=y +# CONFIG_SPIFFS_CACHE_STATS is not set +# end of SPIFFS Cache Configuration + +CONFIG_SPIFFS_PAGE_CHECK=y +CONFIG_SPIFFS_GC_MAX_RUNS=10 +# CONFIG_SPIFFS_GC_STATS is not set +CONFIG_SPIFFS_PAGE_SIZE=256 +CONFIG_SPIFFS_OBJ_NAME_LEN=32 +# CONFIG_SPIFFS_FOLLOW_SYMLINKS is not set +CONFIG_SPIFFS_USE_MAGIC=y +CONFIG_SPIFFS_USE_MAGIC_LENGTH=y +CONFIG_SPIFFS_META_LENGTH=4 +CONFIG_SPIFFS_USE_MTIME=y + +# +# Debug Configuration +# +# CONFIG_SPIFFS_DBG is not set +# CONFIG_SPIFFS_API_DBG is not set +# CONFIG_SPIFFS_GC_DBG is not set +# CONFIG_SPIFFS_CACHE_DBG is not set +# CONFIG_SPIFFS_CHECK_DBG is not set +# CONFIG_SPIFFS_TEST_VISUALISATION is not set +# end of Debug Configuration +# end of SPIFFS Configuration + +# +# TCP Transport +# + +# +# Websocket +# +CONFIG_WS_TRANSPORT=y +CONFIG_WS_BUFFER_SIZE=1024 +# CONFIG_WS_DYNAMIC_BUFFER is not set +# end of Websocket +# end of TCP Transport + +# +# Ultra Low Power (ULP) Co-processor +# +# CONFIG_ULP_COPROC_ENABLED is not set +# end of Ultra Low Power (ULP) Co-processor + +# +# Unity unit testing library +# +CONFIG_UNITY_ENABLE_FLOAT=y +CONFIG_UNITY_ENABLE_DOUBLE=y +# CONFIG_UNITY_ENABLE_64BIT is not set +# CONFIG_UNITY_ENABLE_COLOR is not set +CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y +# CONFIG_UNITY_ENABLE_FIXTURE is not set +# CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL is not set +# end of Unity unit testing library + +# +# USB-OTG +# +CONFIG_USB_OTG_SUPPORTED=y +CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE=256 +CONFIG_USB_HOST_HW_BUFFER_BIAS_BALANCED=y +# CONFIG_USB_HOST_HW_BUFFER_BIAS_IN is not set +# CONFIG_USB_HOST_HW_BUFFER_BIAS_PERIODIC_OUT is not set + +# +# Root Hub configuration +# +CONFIG_USB_HOST_DEBOUNCE_DELAY_MS=250 +CONFIG_USB_HOST_RESET_HOLD_MS=30 +CONFIG_USB_HOST_RESET_RECOVERY_MS=30 +CONFIG_USB_HOST_SET_ADDR_RECOVERY_MS=10 +# end of Root Hub configuration +# end of USB-OTG + +# +# Virtual file system +# +CONFIG_VFS_SUPPORT_IO=y +CONFIG_VFS_SUPPORT_DIR=y +CONFIG_VFS_SUPPORT_SELECT=y +CONFIG_VFS_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_VFS_SUPPORT_TERMIOS=y +CONFIG_VFS_MAX_COUNT=8 + +# +# Host File System I/O (Semihosting) +# +CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# end of Host File System I/O (Semihosting) +# end of Virtual file system + +# +# Wear Levelling +# +# CONFIG_WL_SECTOR_SIZE_512 is not set +CONFIG_WL_SECTOR_SIZE_4096=y +CONFIG_WL_SECTOR_SIZE=4096 +# end of Wear Levelling + +# +# Wi-Fi Provisioning Manager +# +CONFIG_WIFI_PROV_SCAN_MAX_ENTRIES=16 +CONFIG_WIFI_PROV_AUTOSTOP_TIMEOUT=30 +# CONFIG_WIFI_PROV_BLE_FORCE_ENCRYPTION is not set +CONFIG_WIFI_PROV_STA_ALL_CHANNEL_SCAN=y +# CONFIG_WIFI_PROV_STA_FAST_SCAN is not set +# end of Wi-Fi Provisioning Manager +# end of Component config + +# CONFIG_IDF_EXPERIMENTAL_FEATURES is not set + +# Deprecated options for backward compatibility +# CONFIG_APP_BUILD_TYPE_ELF_RAM is not set +# CONFIG_NO_BLOBS is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_NONE is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_ERROR is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_WARN is not set +CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y +# CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG is not set +# CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE is not set +CONFIG_LOG_BOOTLOADER_LEVEL=3 +# CONFIG_APP_ROLLBACK_ENABLE is not set +# CONFIG_FLASH_ENCRYPTION_ENABLED is not set +# CONFIG_FLASHMODE_QIO is not set +# CONFIG_FLASHMODE_QOUT is not set +CONFIG_FLASHMODE_DIO=y +# CONFIG_FLASHMODE_DOUT is not set +CONFIG_MONITOR_BAUD=115200 +CONFIG_OPTIMIZATION_LEVEL_DEBUG=y +CONFIG_COMPILER_OPTIMIZATION_LEVEL_DEBUG=y +# CONFIG_OPTIMIZATION_LEVEL_RELEASE is not set +# CONFIG_COMPILER_OPTIMIZATION_LEVEL_RELEASE is not set +CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y +# CONFIG_OPTIMIZATION_ASSERTIONS_SILENT is not set +# CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED is not set +CONFIG_OPTIMIZATION_ASSERTION_LEVEL=2 +# CONFIG_CXX_EXCEPTIONS is not set +CONFIG_STACK_CHECK_NONE=y +# CONFIG_STACK_CHECK_NORM is not set +# CONFIG_STACK_CHECK_STRONG is not set +# CONFIG_STACK_CHECK_ALL is not set +# CONFIG_WARN_WRITE_STRINGS is not set +# CONFIG_ESP32_APPTRACE_DEST_TRAX is not set +CONFIG_ESP32_APPTRACE_DEST_NONE=y +CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y +# CONFIG_MCPWM_ISR_IN_IRAM is not set +# CONFIG_EXTERNAL_COEX_ENABLE is not set +# CONFIG_ESP_WIFI_EXTERNAL_COEXIST_ENABLE is not set +# CONFIG_EVENT_LOOP_PROFILING is not set +CONFIG_POST_EVENTS_FROM_ISR=y +CONFIG_POST_EVENTS_FROM_IRAM_ISR=y +# CONFIG_OTA_ALLOW_HTTP is not set +CONFIG_ESP32S3_DEEP_SLEEP_WAKEUP_DELAY=2000 +CONFIG_ESP32S3_RTC_CLK_SRC_INT_RC=y +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_CRYS is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_EXT_OSC is not set +# CONFIG_ESP32S3_RTC_CLK_SRC_INT_8MD256 is not set +CONFIG_ESP32S3_RTC_CLK_CAL_CYCLES=1024 +CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y +# CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION is not set +CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20 +CONFIG_ESP32_PHY_MAX_TX_POWER=20 +# CONFIG_REDUCE_PHY_TX_POWER is not set +# CONFIG_ESP32_REDUCE_PHY_TX_POWER is not set +CONFIG_ESP_SYSTEM_PM_POWER_DOWN_CPU=y +CONFIG_ESP32S3_SPIRAM_SUPPORT=y +CONFIG_DEFAULT_PSRAM_CLK_IO=30 +CONFIG_DEFAULT_PSRAM_CS_IO=26 +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_80 is not set +# CONFIG_ESP32S3_DEFAULT_CPU_FREQ_160 is not set +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y +CONFIG_ESP32S3_DEFAULT_CPU_FREQ_MHZ=240 +CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32 +CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304 +CONFIG_MAIN_TASK_STACK_SIZE=3584 +CONFIG_CONSOLE_UART_DEFAULT=y +# CONFIG_CONSOLE_UART_CUSTOM is not set +# CONFIG_CONSOLE_UART_NONE is not set +# CONFIG_ESP_CONSOLE_UART_NONE is not set +CONFIG_CONSOLE_UART=y +CONFIG_CONSOLE_UART_NUM=0 +CONFIG_CONSOLE_UART_BAUDRATE=115200 +CONFIG_INT_WDT=y +CONFIG_INT_WDT_TIMEOUT_MS=300 +CONFIG_INT_WDT_CHECK_CPU1=y +CONFIG_TASK_WDT=y +CONFIG_ESP_TASK_WDT=y +# CONFIG_TASK_WDT_PANIC is not set +CONFIG_TASK_WDT_TIMEOUT_S=5 +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y +CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU1=y +# CONFIG_ESP32_DEBUG_STUBS_ENABLE is not set +CONFIG_ESP32S3_DEBUG_OCDAWARE=y +CONFIG_BROWNOUT_DET=y +CONFIG_ESP32S3_BROWNOUT_DET=y +CONFIG_ESP32S3_BROWNOUT_DET=y +CONFIG_BROWNOUT_DET_LVL_SEL_7=y +CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_7=y +# CONFIG_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_6 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_5 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_4 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_3 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_2 is not set +# CONFIG_BROWNOUT_DET_LVL_SEL_1 is not set +# CONFIG_ESP32S3_BROWNOUT_DET_LVL_SEL_1 is not set +CONFIG_BROWNOUT_DET_LVL=7 +CONFIG_ESP32S3_BROWNOUT_DET_LVL=7 +CONFIG_IPC_TASK_STACK_SIZE=1280 +CONFIG_TIMER_TASK_STACK_SIZE=3584 +CONFIG_ESP32_WIFI_ENABLED=y +CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y +CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 +CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=16 +CONFIG_ESP32_WIFI_CACHE_TX_BUFFER_NUM=32 +# CONFIG_ESP32_WIFI_CSI_ENABLED is not set +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y +CONFIG_ESP32_WIFI_TX_BA_WIN=6 +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +CONFIG_ESP32_WIFI_RX_BA_WIN=6 +# CONFIG_ESP32_WIFI_AMSDU_TX_ENABLED is not set +CONFIG_ESP32_WIFI_NVS_ENABLED=y +CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y +# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set +CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 +CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 +CONFIG_ESP32_WIFI_IRAM_OPT=y +CONFIG_ESP32_WIFI_RX_IRAM_OPT=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y +CONFIG_ESP32_WIFI_ENABLE_WPA3_OWE_STA=y +CONFIG_WPA_MBEDTLS_CRYPTO=y +CONFIG_WPA_MBEDTLS_TLS_CLIENT=y +# CONFIG_WPA_WAPI_PSK is not set +# CONFIG_WPA_SUITE_B_192 is not set +# CONFIG_WPA_11KV_SUPPORT is not set +# CONFIG_WPA_MBO_SUPPORT is not set +# CONFIG_WPA_DPP_SUPPORT is not set +# CONFIG_WPA_11R_SUPPORT is not set +# CONFIG_WPA_WPS_SOFTAP_REGISTRAR is not set +# CONFIG_WPA_WPS_STRICT is not set +# CONFIG_WPA_DEBUG_PRINT is not set +# CONFIG_WPA_TESTING_OPTIONS is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH is not set +# CONFIG_ESP32_ENABLE_COREDUMP_TO_UART is not set +CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=y +CONFIG_TIMER_TASK_PRIORITY=1 +CONFIG_TIMER_TASK_STACK_DEPTH=2048 +CONFIG_TIMER_QUEUE_LENGTH=10 +# CONFIG_ENABLE_STATIC_TASK_CLEAN_UP_HOOK is not set +# CONFIG_HAL_ASSERTION_SILIENT is not set +# CONFIG_L2_TO_L3_COPY is not set +CONFIG_ESP_GRATUITOUS_ARP=y +CONFIG_GARP_TMR_INTERVAL=60 +CONFIG_TCPIP_RECVMBOX_SIZE=32 +CONFIG_TCP_MAXRTX=12 +CONFIG_TCP_SYNMAXRTX=12 +CONFIG_TCP_MSS=1440 +CONFIG_TCP_MSL=60000 +CONFIG_TCP_SND_BUF_DEFAULT=5744 +CONFIG_TCP_WND_DEFAULT=5744 +CONFIG_TCP_RECVMBOX_SIZE=6 +CONFIG_TCP_QUEUE_OOSEQ=y +CONFIG_TCP_OVERSIZE_MSS=y +# CONFIG_TCP_OVERSIZE_QUARTER_MSS is not set +# CONFIG_TCP_OVERSIZE_DISABLE is not set +CONFIG_UDP_RECVMBOX_SIZE=6 +CONFIG_TCPIP_TASK_STACK_SIZE=3072 +CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y +# CONFIG_TCPIP_TASK_AFFINITY_CPU0 is not set +# CONFIG_TCPIP_TASK_AFFINITY_CPU1 is not set +CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF +# CONFIG_PPP_SUPPORT is not set +CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_SYSTIMER=y +CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC_FRC1=y +# CONFIG_ESP32S3_TIME_SYSCALL_USE_RTC is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_SYSTIMER is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_FRC1 is not set +# CONFIG_ESP32S3_TIME_SYSCALL_USE_NONE is not set +CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5 +CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072 +CONFIG_ESP32_PTHREAD_STACK_MIN=768 +CONFIG_ESP32_DEFAULT_PTHREAD_CORE_NO_AFFINITY=y +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_0 is not set +# CONFIG_ESP32_DEFAULT_PTHREAD_CORE_1 is not set +CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1 +CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread" +CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS is not set +# CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED is not set +CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y +CONFIG_SUPPORT_TERMIOS=y +CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS=1 +# End of deprecated options diff --git a/src/uart/CMakeLists.txt b/src/uart/CMakeLists.txt new file mode 100644 index 0000000..64b3e10 --- /dev/null +++ b/src/uart/CMakeLists.txt @@ -0,0 +1,245 @@ +# +# Copyright (C) 2024 Bernd Herzog +# +# This file is part of PortaPack. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +############################################################################## +# Build global options +# NOTE: Can be overridden externally. +# + +cmake_minimum_required(VERSION 3.25) + +MESSAGE(STATUS "Using toolchain file: ${CMAKE_SOURCE_DIR}/${CMAKE_TOOLCHAIN_FILE}") + +#enable_language(C CXX ASM) + +include(CheckCXXCompilerFlag) + +project(uart_app CXX ASM) + +# Compiler options here. +set(USE_OPT "-Os -g --specs=nano.specs --specs=nosys.specs") + +# C specific options here (added to USE_OPT). +set(USE_COPT "-std=gnu99") + +# C++ specific options here (added to USE_OPT). +check_cxx_compiler_flag("-std=c++20" cpp20_supported) +if(cpp20_supported) + set(USE_CPPOPT "-std=c++20") +else() + set(USE_CPPOPT "-std=c++17") +endif() +set(USE_CPPOPT "${USE_CPPOPT} -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized -fno-use-cxa-atexit") + +# Enable this if you want the linker to remove unused code and data +set(USE_LINK_GC yes) + +# Linker extra options here. +#set(USE_LDOPT --nostartfiles) + +# Enable this if you want link time optimizations (LTO) - this flag affects chibios only +set(USE_LTO no) + +# If enabled, this option allows to compile the application in THUMB mode. +set(USE_THUMB yes) + +# Enable this if you want to see the full log while compiling. +set(USE_VERBOSE_COMPILE no) + +# +# Build global options +############################################################################## + +############################################################################## +# Architecture or project specific options +# + +# Enables the use of FPU on Cortex-M4 (no, softfp, hard). +set(USE_FPU no) + +# +# Architecture or project specific options +############################################################################## + +############################################################################## +# Project, sources and paths +# + +# Define linker script file here +set(LDSCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/config/standalone_application_linker_script.ld) + + +# C sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +FILE(GLOB_RECURSE Sources_C ${CMAKE_CURRENT_LIST_DIR}/*.c) +set(CSRC + ${Sources_C} +) + +# C++ sources that can be compiled in ARM or THUMB mode depending on the global +# setting. +FILE(GLOB_RECURSE Sources_CPP ${CMAKE_CURRENT_LIST_DIR}/*.cpp) +set(CPPSRC + ${Sources_CPP} +) + +# C sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +set(ACSRC) + +# C++ sources to be compiled in ARM mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +set(ACPPSRC) + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +set(TCSRC) + +# C sources to be compiled in THUMB mode regardless of the global setting. +# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler +# option that results in lower performance and larger code size. +set(TCPPSRC) + +# List ASM source files here +set(ASMSRC) + +set(INCDIR + ${CMAKE_CURRENT_SOURCE_DIR} +) + +# +# Project, sources and paths +############################################################################## + +############################################################################## +# Compiler settings +# + +# TODO: Entertain using MCU=cortex-m0.small-multiply for LPC43xx M0 core. +# However, on GCC-ARM-Embedded 4.9 2015q2, it seems to produce non-functional +# binaries. +set(MCU cortex-m0) + +# ARM-specific options here +set(AOPT) + +# THUMB-specific options here +set(TOPT "-mthumb -DTHUMB") + +# Define C warning options here +set(CWARN "-Wall -Wextra -Wstrict-prototypes") + +# Define C++ warning options here +set(CPPWARN "-Wall -Wextra -Wno-psabi") + +# +# Compiler settings +############################################################################## + +############################################################################## +# Start of default section +# + +# List all default C defines here, like -D_DEBUG=1 +# TODO: Switch -DCRT0_INIT_DATA depending on load from RAM or SPIFI? +# NOTE: _RANDOM_TCC to kill a GCC 4.9.3 error with std::max argument types +set(DDEFS "-DLPC43XX -DLPC43XX_M0 -D__NEWLIB__ -DHACKRF_ONE -DTOOLCHAIN_GCC -DTOOLCHAIN_GCC_ARM -D_RANDOM_TCC=0") + +# List all default ASM defines here, like -D_DEBUG=1 +set(DADEFS) + +# List all default directories to look for include files here +set(DINCDIR) + +# List the default directory to look for the libraries here +set(DLIBDIR) + +# List all default libraries here +set(DLIBS) + +# +# End of default section +############################################################################## + +############################################################################## +# Start of user section +# + +# List all user C define here, like -D_DEBUG=1 +set(UDEFS) + +# Define ASM defines here +set(UADEFS) + +# List all user directories here +set(UINCDIR) + +# List the user directory to look for the libraries here +set(ULIBDIR) + +# List all user libraries here +set(ULIBS) + +# +# End of user defines +############################################################################## + +include(${CMAKE_CURRENT_SOURCE_DIR}/config/rules.cmake) + +############################################################################## + + +add_executable(${PROJECT_NAME}.ppsi ${CSRC} ${CPPSRC} ${ASMSRC}) +set_target_properties(${PROJECT_NAME}.ppsi PROPERTIES LINK_DEPENDS ${LDSCRIPT}) +add_definitions(${DEFS}) +include_directories(. ${INCDIR}) +link_directories(${LLIBDIR}) + +#target_compile_definitions(${PROJECT_NAME}.ppsi PRIVATE "${DDEFS}") +#target_compile_features (${PROJECT_NAME}.ppsi PRIVATE cxx_std_17) +#target_compile_options (${PROJECT_NAME}.ppsi PRIVATE -Os -g -mcpu=cortex-m0 -mno-thumb-interwork -mthumb -fno-common --specs=nano.specs --specs=nosys.specs -fno-rtti -fno-exceptions -Weffc++ -Wuninitialized -fno-use-cxa-atexit) + +target_link_libraries(${PROJECT_NAME}.ppsi -Wl,-Map=${PROJECT_NAME}.map) +target_link_libraries(${PROJECT_NAME}.ppsi "-Wl,--print-memory-usage") +#target_link_libraries(${PROJECT_NAME}.ppsi "-nostartfiles") +#target_link_libraries(${PROJECT_NAME}.ppsi "-Wl,--cref,--no-warn-mismatch") +#target_link_libraries(${PROJECT_NAME}.ppsi "-Wl,--entry=_standalone_application_information") +#target_link_libraries(${PROJECT_NAME}.ppsi "-Wl,-T${LDSCRIPT}") + +# redirect std lib memory allocations +target_link_libraries(${PROJECT_NAME}.ppsi "-Wl,-wrap,_malloc_r") +target_link_libraries(${PROJECT_NAME}.ppsi "-Wl,-wrap,_free_r") + +add_custom_command( + OUTPUT ${PROJECT_NAME}.ppmp + COMMAND ${CMAKE_OBJCOPY} -v -O binary ${PROJECT_NAME}.ppsi.elf ${PROJECT_NAME}.ppmp + COMMAND ${CMAKE_OBJDUMP} --source ${PROJECT_NAME}.ppsi.elf > ${PROJECT_NAME}.objdump.txt + COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/config/create_header.py ${PROJECT_NAME}.ppmp ${PROJECT_NAME}.h + DEPENDS ${PROJECT_NAME}.ppsi +) + +add_custom_target( + ${PROJECT_NAME} + DEPENDS ${PROJECT_NAME}.ppmp +) diff --git a/src/uart/Readme.md b/src/uart/Readme.md new file mode 100644 index 0000000..3aa4408 --- /dev/null +++ b/src/uart/Readme.md @@ -0,0 +1,10 @@ +# to build + +cmake -DCMAKE_TOOLCHAIN_FILE=arm-none-eabi-toolchain.cmake -B build -S. +make -C build uart_app + + +# build with docker +docker build -t arm-docker-build config +docker run --rm -v .:/src -w /src arm-docker-build bash -c "cmake -DCMAKE_TOOLCHAIN_FILE=config/arm-none-eabi-toolchain.cmake -B build -S." +docker run --rm -v .:/src -w /src arm-docker-build bash -c "make -C build -j3 uart_app" diff --git a/src/uart/config/Dockerfile b/src/uart/config/Dockerfile new file mode 100644 index 0000000..745f39d --- /dev/null +++ b/src/uart/config/Dockerfile @@ -0,0 +1,30 @@ +# +# Copyright (C) 2024 Bernd Herzog +# +# This file is part of PortaPack. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +FROM debian:bookworm-slim + +RUN apt-get update && apt-get install -y \ + build-essential \ + make cmake \ + git gnupg2 \ + xz-utils curl \ + gcc-arm-none-eabi binutils-arm-none-eabi \ + clang-format clang-tidy && mkdir /build diff --git a/src/uart/config/arm-none-eabi-toolchain.cmake b/src/uart/config/arm-none-eabi-toolchain.cmake new file mode 100644 index 0000000..9485803 --- /dev/null +++ b/src/uart/config/arm-none-eabi-toolchain.cmake @@ -0,0 +1,29 @@ +set(CMAKE_SYSTEM_NAME Generic) +set(CMAKE_SYSTEM_PROCESSOR arm) +set(TOOLCHAIN_PREFIX arm-none-eabi-) + +set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) +#set(CMAKE_MAKE_PROGRAM make) +#set(FLAGS "-fdata-sections -ffunction-sections --specs=nano.specs -Wl,--gc-sections") + +#set(CPP_FLAGS "-fno-rtti -fno-exceptions -fno-threadsafe-statics") + +set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) +set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) +set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++) +set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy) +set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size) + +set(CMAKE_AR ${TOOLCHAIN_PREFIX}ar) + +set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf") +set(CMAKE_EXECUTABLE_SUFFIX_C ".elf") +set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf") + + +# --specs=nano.specs +SET(CMAKE_C_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fdata-sections -ffunction-sections -Wl,--gc-sections") +SET(CMAKE_CXX_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fdata-sections -ffunction-sections -Wl,--gc-sections") + +SET(CMAKE_EXE_LINKER_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard") + diff --git a/src/uart/config/create_header.py b/src/uart/config/create_header.py new file mode 100644 index 0000000..3dcbd05 --- /dev/null +++ b/src/uart/config/create_header.py @@ -0,0 +1,60 @@ +# +# Copyright (C) 2024 Bernd Herzog +# +# This file is part of PortaPack. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 51 Franklin Street, +# Boston, MA 02110-1301, USA. +# + +### NOTE: AI GENERATED CODE ### +### to convert a binary file to a C header file ### + +import sys +import os + +def create_c_header(binary_file, header_file): + try: + with open(binary_file, 'rb') as bf: + binary_content = bf.read() + + variable_name = os.path.splitext(os.path.basename(binary_file))[0] + header_content = f"unsigned char {variable_name}[] = {{\n" + for i in range(0, len(binary_content), 16): + line = ', '.join(f'0x{byte:02x}' for byte in binary_content[i:i+16]) + header_content += f" {line},\n" + + # Pad with zeroes if the size is not divisible by 128 + remainder = len(binary_content) % 128 + if remainder != 0: + padding_size = 128 - remainder + header_content += f" {', '.join('0x00' for _ in range(padding_size))},\n" + + header_content = header_content.rstrip(',\n') + "\n};\n" + + with open(header_file, 'w') as hf: + hf.write(header_content) + + print(f"Header file '{header_file}' created successfully.") + except Exception as e: + print(f"Error: {e}") + +if __name__ == "__main__": + if len(sys.argv) != 3: + print("Usage: python create_include.py ") + else: + binary_file = sys.argv[1] + header_file = sys.argv[2] + create_c_header(binary_file, header_file) diff --git a/src/uart/config/rules.cmake b/src/uart/config/rules.cmake new file mode 100644 index 0000000..2e20d85 --- /dev/null +++ b/src/uart/config/rules.cmake @@ -0,0 +1,107 @@ +# ARM Cortex-Mx common makefile scripts and rules. + +############################################################################## +# Processing options coming from the upper Makefile. +# + +# Compiler options +set(OPT ${USE_OPT}) +set(COPT ${USE_COPT}) +set(CPPOPT ${USE_CPPOPT}) + +# Garbage collection +if(USE_LINK_GC STREQUAL "yes") + set(OPT "${OPT} -ffunction-sections -fdata-sections -fno-common") + set(LDOPT ",--gc-sections") +else() + set(LDOPT) +endif() + +# Linker extra options +if(DEFINED USE_LDOPT) + set(LDOPT "${LDOPT},${USE_LDOPT}") +endif() + +# Link time optimizations +if(USE_LTO STREQUAL "yes") + set(OPT "${OPT} -flto") +endif() + +# FPU-related options +if(NOT DEFINED USE_FPU) + set(USE_FPU no) +endif() +if(NOT USE_FPU STREQUAL "no") + set(OPT "${OPT} -mfloat-abi=${USE_FPU} -mfpu=fpv4-sp-d16 -fsingle-precision-constant") + set(DDEFS ${DDEFS} -DCORTEX_USE_FPU=TRUE) + set(DADEFS ${DADEFS} -DCORTEX_USE_FPU=TRUE) +else() + set(DDEFS ${DDEFS} -DCORTEX_USE_FPU=FALSE) + set(DADEFS ${DADEFS} -DCORTEX_USE_FPU=FALSE) +endif() + +# Source files groups and paths +if(USE_THUMB STREQUAL "yes") + set(TCSRC ${TCSRC} ${CSRC}) + set(TCPPSRC ${TCPPSRC} ${CPPSRC}) +else() + set(ACSRC ${ACSRC} ${CSRC}) + set(ACPPSRC ${ACPPSRC} ${CPPSRC}) +endif() +set(ASRC ${ACSRC} ${ACPPSRC}) +set(TSRC ${TCSRC} ${TCPPSRC}) + +# Paths +set(IINCDIR ${INCDIR} ${DINCDIR} ${UINCDIR}) +set(LLIBDIR ${DLIBDIR} ${ULIBDIR}) + +# Macros +set(DEFS ${DDEFS} ${UDEFS}) +set(ADEFS ${DADEFS} ${UADEFS}) + +# Libs +set(LIBS ${DLIBS} ${ULIBS}) + +# Various settings +set(MCFLAGS -mcpu=${MCU}) +set(ODFLAGS "-x --syms") +set(ASFLAGS "${MCFLAGS} ${ADEFS}") +set(ASXFLAGS "${MCFLAGS} ${ADEFS}") +set(CFLAGS "${MCFLAGS} ${OPT} ${COPT} ${CWARN}") +set(CPPFLAGS "${MCFLAGS} ${OPT} ${CPPOPT} ${CPPWARN}") +set(LDFLAGS "-nostartfiles -Wl,--library-path=${RULESPATH},--script=${LDSCRIPT}${LDOPT}") + +# Thumb interwork enabled only if needed because it kills performance. +if(DEFINED TSRC) + set(CFLAGS "${CFLAGS}") + set(CPPFLAGS "${CPPFLAGS}") + set(ASFLAGS "${ASFLAGS}") + set(DEFS ${DEFS} -DTHUMB_PRESENT) + set(ADEFS ${ADEFS} -DTHUMB_PRESENT) + if(DEFINED ASRC) + # Mixed ARM and THUMB mode. + set(CFLAGS "${CFLAGS} -mthumb-interwork") + set(CPPFLAGS "${CPPFLAGS} -mthumb-interwork") + set(ASFLAGS "${ASFLAGS} -mthumb-interwork") + set(LDFLAGS "${LDFLAGS} -mthumb-interwork") + else() + # Pure THUMB mode, THUMB C code cannot be called by ARM asm code directly. + set(CFLAGS "${CFLAGS} -mno-thumb-interwork") + set(CPPFLAGS "${CPPFLAGS} -mno-thumb-interwork") + set(ASFLAGS "${ASFLAGS} -mno-thumb-interwork -mthumb") + set(LDFLAGS "${LDFLAGS} -mno-thumb-interwork -mthumb") + set(DEFS ${DEFS} -DTHUMB_NO_INTERWORKING) + set(ADEFS ${ADEFS} -DTHUMB_NO_INTERWORKING) + endif() +else() + # Pure ARM mode + set(CFLAGS "${CFLAGS} -mno-thumb-interwork") + set(CPPFLAGS "${CPPFLAGS} -mno-thumb-interwork") + set(ASFLAGS "${ASFLAGS} -mno-thumb-interwork") + set(LDFLAGS "${LDFLAGS} -mno-thumb-interwork") +endif() + +set(CMAKE_C_FLAGS "${CFLAGS} ${TOPT}") +set(CMAKE_CXX_FLAGS "${CPPFLAGS} ${TOPT}") +set(CMAKE_AS_FLAGS "${ASFLAGS} ${TOPT}") +set(CMAKE_EXE_LINKER_FLAGS "${LDFLAGS}") diff --git a/src/uart/config/standalone_application_linker_script.ld b/src/uart/config/standalone_application_linker_script.ld new file mode 100644 index 0000000..4048f93 --- /dev/null +++ b/src/uart/config/standalone_application_linker_script.ld @@ -0,0 +1,118 @@ +/* + Copyright (C) 2024 Bernd Herzog + + Licensed 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. +*/ + +MEMORY +{ + ram : org = 0xADB10000, len = 64k /* DO NOT CHANGE the address. We make the image relocateable on load. It needs to be 0xADB10000 */ +} + +__ram_start__ = ORIGIN(ram); +__ram_size__ = LENGTH(ram); +__ram_end__ = __ram_start__ + __ram_size__; + +SECTIONS +{ + . = 0; + _text = .; + startup : ALIGN(16) SUBALIGN(16) + { + KEEP(*(.standalone_application_information)); + } > ram + + constructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE(__init_array_end = .); + } > ram + + destructors : ALIGN(4) SUBALIGN(4) + { + PROVIDE(__fini_array_start = .); + KEEP(*(.fini_array)) + KEEP(*(SORT(.fini_array.*))) + PROVIDE(__fini_array_end = .); + } > ram + + .text : ALIGN(16) SUBALIGN(16) + { + *(.text.startup.*) + *(.text) + *(.text.*) + *(.rodata) + *(.rodata.*) + *(.glue_7t) + *(.glue_7) + *(.gcc*) + } > ram + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > ram + + .ARM.exidx : { + PROVIDE(__exidx_start = .); + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + PROVIDE(__exidx_end = .); + } > ram + + .eh_frame_hdr : + { + *(.eh_frame_hdr) + } > ram + + .eh_frame : ONLY_IF_RO + { + *(.eh_frame) + } > ram + + .textalign : ONLY_IF_RO + { + . = ALIGN(8); + } > ram + + .bss ALIGN(4) : ALIGN(4) + { + . = ALIGN(4); + PROVIDE(_bss_start = .); + *(.bss) + *(.bss.*) + *(COMMON) + . = ALIGN(4); + PROVIDE(_bss_end = .); + } > ram + + . = ALIGN(4); + _etext = .; + _textdata = _etext; + + .data ALIGN(4) : AT (_textdata) + { + . = ALIGN(4); + PROVIDE(_data = .); + *(.data) + *(.data.*) + *(.ramtext) + . = ALIGN(4); + PROVIDE(_edata = .); + } > ram +} + +PROVIDE(end = .); +_end = .; + diff --git a/src/uart/standalone_application.hpp b/src/uart/standalone_application.hpp new file mode 100644 index 0000000..3ed3792 --- /dev/null +++ b/src/uart/standalone_application.hpp @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2024 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __UI_STANDALONE_APP_H__ +#define __UI_STANDALONE_APP_H__ + +#include +#include +#include +#include + +#include "ui/ui.hpp" + +#define CURRENT_STANDALONE_APPLICATION_API_VERSION 2 + +struct standalone_application_api_t +{ + // Version 1 + void *(*malloc)(size_t size); + void *(*calloc)(size_t num, size_t size); + void *(*realloc)(void *p, size_t size); + void (*free)(void *p); + void (*create_thread)(int32_t (*fn)(void *), void *arg, size_t stack_size, int priority); + void (*fill_rectangle)(int x, int y, int width, int height, uint16_t color); + uint8_t (*swizzled_switches)(); + uint64_t (*get_switches_state)(); + + // Version 2 + const uint8_t *fixed_5x8_glyph_data; + const uint8_t *fixed_8x16_glyph_data; + + void (*fill_rectangle_unrolled8)(int x, int y, int width, int height, uint16_t color); + void (*draw_bitmap)(int x, int y, int width, int height, const uint8_t *pixels, uint16_t foreground, uint16_t background); + + ui::Coord (*scroll_area_y)(const ui::Coord y); + void (*scroll_set_area)(const ui::Coord top_y, const ui::Coord bottom_y); + void (*scroll_disable)(); + ui::Coord (*scroll_set_position)(const ui::Coord position); + ui::Coord (*scroll)(const int32_t delta); + + bool (*i2c_read)(uint8_t *cmd, size_t cmd_len, uint8_t *data, size_t data_len); + void (*panic)(const char *msg); + void (*set_dirty)(); +}; + +extern const standalone_application_api_t *_api; + +enum app_location_t : uint32_t +{ + UTILITIES = 0, + RX, + TX, + DEBUG, + HOME +}; + +struct standalone_application_information_t +{ + uint32_t header_version; + + uint8_t app_name[16]; + uint8_t bitmap_data[32]; + uint32_t icon_color; + app_location_t menu_location; + + /// @brief gets called once at application start + void (*initialize)(const standalone_application_api_t &api); + + /// @brief gets called when an event occurs + /// @param events bitfield of events + /// @note events are defined in firmware/application/event_m0.hpp + void (*on_event)(const uint32_t &events); + + /// @brief gets called once at application shutdown + void (*shutdown)(); + + void (*PaintViewMirror)(); + void (*OnTouchEvent)(int x, int y, uint32_t type); + void (*OnFocus)(); + bool (*OnKeyEvent)(uint8_t key); + bool (*OnEncoder)(int32_t delta); + bool (*OnKeyboad)(uint8_t key); +}; + +extern "C" void initialize(const standalone_application_api_t &api); +extern "C" void on_event(const uint32_t &events); +extern "C" void shutdown(); +extern "C" void PaintViewMirror(); +extern "C" void OnTouchEvent(int x, int y, uint32_t type); +extern "C" void OnFocus(); +extern "C" bool OnKeyEvent(uint8_t key); +extern "C" bool OnEncoder(int32_t delta); +extern "C" bool OnKeyboad(uint8_t key); + +#endif /*__UI_STANDALONE_APP_H__*/ diff --git a/src/uart/standalone_application_entry.cpp b/src/uart/standalone_application_entry.cpp new file mode 100644 index 0000000..f789063 --- /dev/null +++ b/src/uart/standalone_application_entry.cpp @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2024 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "standalone_application.hpp" +#include + +const standalone_application_api_t *_api; + +extern "C" +{ + __attribute__((section(".standalone_application_information"), used)) standalone_application_information_t _standalone_application_information = { + /*.header_version = */ CURRENT_STANDALONE_APPLICATION_API_VERSION, + + /*.app_name = */ "UART", + /*.bitmap_data = */ { + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0xFC, + 0x3F, + 0xFE, + 0x7F, + 0x02, + 0x40, + 0xBA, + 0x45, + 0x02, + 0x40, + 0xFE, + 0x7F, + 0xFE, + 0x7F, + 0x92, + 0x7C, + 0x92, + 0x7C, + 0xFC, + 0x3F, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + }, + /*.icon_color = 16 bit: 5R 6G 5B*/ 0x0000FFE0, + /*.menu_location = */ app_location_t::UTILITIES, + + /*.initialize_app = */ initialize, + /*.on_event = */ on_event, + /*.shutdown = */ shutdown, + /*.PaintViewMirror = */ PaintViewMirror, + /*.OnTouchEvent = */ OnTouchEvent, + /*.OnFocus = */ OnFocus, + /*.OnKeyEvent = */ OnKeyEvent, + /*.OnEncoder = */ OnEncoder, + /*.OnKeyboad = */ OnKeyboad, + }; +} + +/* Implementing abort() eliminates requirement for _getpid(), _kill(), _exit(). */ +extern "C" void abort() +{ + while (true) + ; +} + +// replace memory allocations to use heap from chibios +extern "C" void *malloc(size_t size) +{ + return _api->malloc(size); +} +extern "C" void *calloc(size_t num, size_t size) +{ + return _api->calloc(num, size); +} +extern "C" void *realloc(void *p, size_t size) +{ + return _api->realloc(p, size); +} +extern "C" void free(void *p) +{ + _api->free(p); +} + +// redirect std lib memory allocations (sprintf, etc.) +extern "C" void *__wrap__malloc_r(size_t size) +{ + return _api->malloc(size); +} +extern "C" void __wrap__free_r(void *p) +{ + _api->free(p); +} diff --git a/src/uart/uart.cpp b/src/uart/uart.cpp new file mode 100644 index 0000000..70ee8d9 --- /dev/null +++ b/src/uart/uart.cpp @@ -0,0 +1,214 @@ +/* + * Copyright (C) 2024 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "uart.hpp" + +#include +#include + +StandaloneViewMirror *standaloneViewMirror = nullptr; +ui::Context *context = nullptr; + +extern "C" void initialize(const standalone_application_api_t &api) +{ + _api = &api; + + context = new ui::Context(); + standaloneViewMirror = new StandaloneViewMirror(*context, {0, 16, 240, 304}); + + Command cmd = Command::COMMAND_UART_BAUDRATE_GET; + std::vector data(4); + + if (_api->i2c_read((uint8_t *)&cmd, 2, data.data(), data.size()) == false) + return; + + uint32_t baudrate = *(uint32_t *)data.data(); + standaloneViewMirror->set_baudrate(baudrate); +} + +extern "C" void on_event(const uint32_t &events) +{ + (void)events; + + if (standaloneViewMirror->isBaudrateChanged()) + { + Command cmd = Command::COMMAND_UART_BAUDRATE_GET; + std::vector data(4); + + if (_api->i2c_read((uint8_t *)&cmd, 2, data.data(), data.size()) == false) + return; + + uint32_t baudrate = *(uint32_t *)data.data(); + standaloneViewMirror->set_baudrate(baudrate); + return; + } + + Command cmd = Command::COMMAND_UART_REQUESTDATA_SHORT; + std::vector data(5); + + uint8_t more_data_available; + do + { + if (_api->i2c_read((uint8_t *)&cmd, 2, data.data(), data.size()) == false) + return; + + uint8_t data_len = data[0] & 0x7f; + more_data_available = data[0] >> 7; + uint8_t *data_ptr = data.data() + 1; + + if (data_len > 0) + { + standaloneViewMirror->get_console().write(std::string((char *)data_ptr, data_len)); + } + + if (more_data_available) + { + cmd = Command::COMMAND_UART_REQUESTDATA_LONG; + data = std::vector(128); + } + } while (more_data_available == 1); +} + +extern "C" void shutdown() +{ + delete standaloneViewMirror; + delete context; +} + +extern "C" void PaintViewMirror() +{ + ui::Painter painter; + if (standaloneViewMirror) + painter.paint_widget_tree(standaloneViewMirror); +} + +ui::Widget *touch_widget(ui::Widget *const w, ui::TouchEvent event) +{ + if (!w->hidden()) + { + // To achieve reverse depth ordering (last object drawn is + // considered "top"), descend first. + for (const auto child : w->children()) + { + const auto touched_widget = touch_widget(child, event); + if (touched_widget) + { + return touched_widget; + } + } + + const auto r = w->screen_rect(); + if (r.contains(event.point)) + { + if (w->on_touch(event)) + { + // This widget responded. Return it up the call stack. + return w; + } + } + } + return nullptr; +} + +ui::Widget *captured_widget{nullptr}; + +extern "C" void OnTouchEvent(int x, int y, uint32_t type) +{ + if (standaloneViewMirror) + { + ui::TouchEvent event{{x, y}, static_cast(type)}; + + if (event.type == ui::TouchEvent::Type::Start) + { + captured_widget = touch_widget(standaloneViewMirror, event); + + if (captured_widget) + { + captured_widget->focus(); + captured_widget->set_dirty(); + } + } + + if (captured_widget) + captured_widget->on_touch(event); + } +} + +extern "C" void OnFocus() +{ + if (standaloneViewMirror) + standaloneViewMirror->focus(); +} + +extern "C" bool OnKeyEvent(uint8_t key_val) +{ + ui::KeyEvent key = (ui::KeyEvent)key_val; + if (context) + { + auto focus_widget = context->focus_manager().focus_widget(); + + if (focus_widget) + { + if (focus_widget->on_key(key)) + return true; + + context->focus_manager().update(standaloneViewMirror, key); + + if (focus_widget != context->focus_manager().focus_widget()) + return true; + else + { + if (key == ui::KeyEvent::Up || key == ui::KeyEvent::Back || key == ui::KeyEvent::Left) + { + focus_widget->blur(); + return false; + } + } + } + } + return false; +} + +extern "C" bool OnEncoder(int32_t delta) +{ + if (context) + { + auto focus_widget = context->focus_manager().focus_widget(); + + if (focus_widget) + return focus_widget->on_encoder((ui::EncoderEvent)delta); + } + + return false; +} + +extern "C" bool OnKeyboad(uint8_t key) +{ + if (context) + { + auto focus_widget = context->focus_manager().focus_widget(); + + if (focus_widget) + return focus_widget->on_keyboard((ui::KeyboardEvent)key); + } + + return false; +} diff --git a/src/uart/uart.hpp b/src/uart/uart.hpp new file mode 100644 index 0000000..4ce04df --- /dev/null +++ b/src/uart/uart.hpp @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2024 Bernd Herzog + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#pragma once + +#include "standalone_application.hpp" + +#include "ui/ui_widget.hpp" +#include "ui/theme.hpp" + +#define USER_COMMANDS_START 0x7F01 + +enum class Command : uint16_t +{ + // UART specific commands + COMMAND_UART_REQUESTDATA_SHORT = USER_COMMANDS_START, + COMMAND_UART_REQUESTDATA_LONG, + COMMAND_UART_BAUDRATE_INC, + COMMAND_UART_BAUDRATE_DEC, + COMMAND_UART_BAUDRATE_GET +}; + +class StandaloneViewMirror : public ui::View +{ +public: + StandaloneViewMirror(ui::Context &context, const ui::Rect parent_rect) : View{parent_rect}, context_(context) + { + set_style(ui::Theme::getInstance()->bg_dark); + + add_children({&text, + &console, + &button_n, + &button_p + + }); + + text.set("BR: " + std::to_string(baudrate_)); + + button_n.on_select = [this](ui::Button &) + { + Command cmd_dec = Command::COMMAND_UART_BAUDRATE_DEC; + _api->i2c_read((uint8_t *)&cmd_dec, 2, nullptr, 0); + + baudrate_dirty_ = true; + }; + + button_p.on_select = [this](ui::Button &) + { + Command cmd_inc = Command::COMMAND_UART_BAUDRATE_INC; + _api->i2c_read((uint8_t *)&cmd_inc, 2, nullptr, 0); + + baudrate_dirty_ = true; + }; + } + + ui::Console &get_console() + { + return console; + } + + ui::Context &context() const override + { + return context_; + } + + void focus() override + { + button_n.focus(); + } + + void set_baudrate(uint32_t baudrate) + { + baudrate_ = baudrate; + baudrate_dirty_ = false; + + text.set("BR: " + std::to_string(baudrate_)); + + set_dirty(); + } + + bool isBaudrateChanged() + { + return baudrate_dirty_; + } + +private: + ui::Text text{{4, 4, 96, 16}}; + + ui::Button button_n{{100, 4, 16, 24}, "-"}; + ui::Button button_p{{120, 4, 16, 24}, "+"}; + + ui::Console console{{0, 2 * 16, 240, 272}}; + + ui::Context &context_; + + uint32_t baudrate_{115200}; + bool baudrate_dirty_{true}; +}; diff --git a/src/uart/ui/complex.hpp b/src/uart/ui/complex.hpp new file mode 100644 index 0000000..ac24b0a --- /dev/null +++ b/src/uart/ui/complex.hpp @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __COMPLEX_H__ +#define __COMPLEX_H__ + +#include +#include +#include + +constexpr float pi{3.141592653589793238462643383279502884f}; + +namespace std { + +template <> +struct complex { + public: + typedef int8_t value_type; + typedef uint16_t rep_type; + + constexpr complex( + int8_t re = 0, + int8_t im = 0) + : _v{re, im} { + } + + constexpr int8_t real() const { return _v[0]; } + constexpr int8_t imag() const { return _v[1]; } + + void real(int8_t v) { _v[0] = v; } + void imag(int8_t v) { _v[1] = v; } + + constexpr uint16_t __rep() const { + return _rep; + } + + private: + union { + value_type _v[2]; + rep_type _rep; + }; +}; + +template <> +struct complex { + public: + typedef int16_t value_type; + typedef uint32_t rep_type; + + constexpr complex( + int16_t re = 0, + int16_t im = 0) + : _v{re, im} { + } + + constexpr int16_t real() const { return _v[0]; } + constexpr int16_t imag() const { return _v[1]; } + + void real(int16_t v) { _v[0] = v; } + void imag(int16_t v) { _v[1] = v; } + + template + complex& operator+=(const complex& other) { + _v[0] += other.real(); + _v[1] += other.imag(); + return *this; + } + + constexpr uint32_t __rep() const { + return _rep; + } + + constexpr operator std::complex() const { + return { + static_cast(_v[0]), + static_cast(_v[1])}; + } + + private: + union { + value_type _v[2]; + rep_type _rep; + }; +}; + +} /* namespace std */ + +using complex8_t = std::complex; +using complex16_t = std::complex; +using complex32_t = std::complex; + +static_assert(sizeof(complex8_t) == 2, "complex8_t size wrong"); +static_assert(sizeof(complex16_t) == 4, "complex16_t size wrong"); +static_assert(sizeof(complex32_t) == 8, "complex32_t size wrong"); + +#endif /*__COMPLEX_H__*/ diff --git a/src/uart/ui/sine_table.hpp b/src/uart/ui/sine_table.hpp new file mode 100644 index 0000000..b0d72e6 --- /dev/null +++ b/src/uart/ui/sine_table.hpp @@ -0,0 +1,147 @@ +/* + * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __SINE_TABLE_H__ +#define __SINE_TABLE_H__ + +// TODO: Including only for pi. Need separate math.hpp... +#include "complex.hpp" + +#include +#include + +/* +import numpy +length = 256 +w = numpy.arange(length, dtype=numpy.float64) * (2 * numpy.pi / length) +v = numpy.sin(w) +print(v) +*/ +constexpr uint16_t sine_table_f32_period = 256; +// periode is 256 . means sine_table_f32[0]= sine_table_f32[0+256], sine_table_f32[1]=sine_table_f32[1+256] (those two added manualy) +// Then table has 258 values ,256:[0,..255] + [256] and [257], those two are used when we interpolate[255] with [255+1], and [256] with [256+1] +// [256] index is needed in the function sin_f32() when we are inputing very small radian values , example , sin_f32((-1e-14) in radians) + +static constexpr std::array sine_table_f32{ + 0.00000000e+00, 2.45412285e-02, 4.90676743e-02, + 7.35645636e-02, 9.80171403e-02, 1.22410675e-01, + 1.46730474e-01, 1.70961889e-01, 1.95090322e-01, + 2.19101240e-01, 2.42980180e-01, 2.66712757e-01, + 2.90284677e-01, 3.13681740e-01, 3.36889853e-01, + 3.59895037e-01, 3.82683432e-01, 4.05241314e-01, + 4.27555093e-01, 4.49611330e-01, 4.71396737e-01, + 4.92898192e-01, 5.14102744e-01, 5.34997620e-01, + 5.55570233e-01, 5.75808191e-01, 5.95699304e-01, + 6.15231591e-01, 6.34393284e-01, 6.53172843e-01, + 6.71558955e-01, 6.89540545e-01, 7.07106781e-01, + 7.24247083e-01, 7.40951125e-01, 7.57208847e-01, + 7.73010453e-01, 7.88346428e-01, 8.03207531e-01, + 8.17584813e-01, 8.31469612e-01, 8.44853565e-01, + 8.57728610e-01, 8.70086991e-01, 8.81921264e-01, + 8.93224301e-01, 9.03989293e-01, 9.14209756e-01, + 9.23879533e-01, 9.32992799e-01, 9.41544065e-01, + 9.49528181e-01, 9.56940336e-01, 9.63776066e-01, + 9.70031253e-01, 9.75702130e-01, 9.80785280e-01, + 9.85277642e-01, 9.89176510e-01, 9.92479535e-01, + 9.95184727e-01, 9.97290457e-01, 9.98795456e-01, + 9.99698819e-01, 1.00000000e+00, 9.99698819e-01, + 9.98795456e-01, 9.97290457e-01, 9.95184727e-01, + 9.92479535e-01, 9.89176510e-01, 9.85277642e-01, + 9.80785280e-01, 9.75702130e-01, 9.70031253e-01, + 9.63776066e-01, 9.56940336e-01, 9.49528181e-01, + 9.41544065e-01, 9.32992799e-01, 9.23879533e-01, + 9.14209756e-01, 9.03989293e-01, 8.93224301e-01, + 8.81921264e-01, 8.70086991e-01, 8.57728610e-01, + 8.44853565e-01, 8.31469612e-01, 8.17584813e-01, + 8.03207531e-01, 7.88346428e-01, 7.73010453e-01, + 7.57208847e-01, 7.40951125e-01, 7.24247083e-01, + 7.07106781e-01, 6.89540545e-01, 6.71558955e-01, + 6.53172843e-01, 6.34393284e-01, 6.15231591e-01, + 5.95699304e-01, 5.75808191e-01, 5.55570233e-01, + 5.34997620e-01, 5.14102744e-01, 4.92898192e-01, + 4.71396737e-01, 4.49611330e-01, 4.27555093e-01, + 4.05241314e-01, 3.82683432e-01, 3.59895037e-01, + 3.36889853e-01, 3.13681740e-01, 2.90284677e-01, + 2.66712757e-01, 2.42980180e-01, 2.19101240e-01, + 1.95090322e-01, 1.70961889e-01, 1.46730474e-01, + 1.22410675e-01, 9.80171403e-02, 7.35645636e-02, + 4.90676743e-02, 2.45412285e-02, 1.22464680e-16, + -2.45412285e-02, -4.90676743e-02, -7.35645636e-02, + -9.80171403e-02, -1.22410675e-01, -1.46730474e-01, + -1.70961889e-01, -1.95090322e-01, -2.19101240e-01, + -2.42980180e-01, -2.66712757e-01, -2.90284677e-01, + -3.13681740e-01, -3.36889853e-01, -3.59895037e-01, + -3.82683432e-01, -4.05241314e-01, -4.27555093e-01, + -4.49611330e-01, -4.71396737e-01, -4.92898192e-01, + -5.14102744e-01, -5.34997620e-01, -5.55570233e-01, + -5.75808191e-01, -5.95699304e-01, -6.15231591e-01, + -6.34393284e-01, -6.53172843e-01, -6.71558955e-01, + -6.89540545e-01, -7.07106781e-01, -7.24247083e-01, + -7.40951125e-01, -7.57208847e-01, -7.73010453e-01, + -7.88346428e-01, -8.03207531e-01, -8.17584813e-01, + -8.31469612e-01, -8.44853565e-01, -8.57728610e-01, + -8.70086991e-01, -8.81921264e-01, -8.93224301e-01, + -9.03989293e-01, -9.14209756e-01, -9.23879533e-01, + -9.32992799e-01, -9.41544065e-01, -9.49528181e-01, + -9.56940336e-01, -9.63776066e-01, -9.70031253e-01, + -9.75702130e-01, -9.80785280e-01, -9.85277642e-01, + -9.89176510e-01, -9.92479535e-01, -9.95184727e-01, + -9.97290457e-01, -9.98795456e-01, -9.99698819e-01, + -1.00000000e+00, -9.99698819e-01, -9.98795456e-01, + -9.97290457e-01, -9.95184727e-01, -9.92479535e-01, + -9.89176510e-01, -9.85277642e-01, -9.80785280e-01, + -9.75702130e-01, -9.70031253e-01, -9.63776066e-01, + -9.56940336e-01, -9.49528181e-01, -9.41544065e-01, + -9.32992799e-01, -9.23879533e-01, -9.14209756e-01, + -9.03989293e-01, -8.93224301e-01, -8.81921264e-01, + -8.70086991e-01, -8.57728610e-01, -8.44853565e-01, + -8.31469612e-01, -8.17584813e-01, -8.03207531e-01, + -7.88346428e-01, -7.73010453e-01, -7.57208847e-01, + -7.40951125e-01, -7.24247083e-01, -7.07106781e-01, + -6.89540545e-01, -6.71558955e-01, -6.53172843e-01, + -6.34393284e-01, -6.15231591e-01, -5.95699304e-01, + -5.75808191e-01, -5.55570233e-01, -5.34997620e-01, + -5.14102744e-01, -4.92898192e-01, -4.71396737e-01, + -4.49611330e-01, -4.27555093e-01, -4.05241314e-01, + -3.82683432e-01, -3.59895037e-01, -3.36889853e-01, + -3.13681740e-01, -2.90284677e-01, -2.66712757e-01, + -2.42980180e-01, -2.19101240e-01, -1.95090322e-01, + -1.70961889e-01, -1.46730474e-01, -1.22410675e-01, + -9.80171403e-02, -7.35645636e-02, -4.90676743e-02, + -2.45412285e-02, 0.00000000e+00, 2.45412285e-02}; + +inline float sin_f32(const float w) { + const float x = w / (2 * pi); // normalization + const float x_frac = x - std::floor(x); // [0, 1] + + const float n = x_frac * sine_table_f32_period; + const uint16_t n_int = static_cast(n); + const float n_frac = n - n_int; + + const float p0 = sine_table_f32[n_int]; + const float p1 = sine_table_f32[n_int + 1]; + const float diff = p1 - p0; + const float result = p0 + n_frac * diff; // linear interpolation + + return result; +} + +#endif /*__SINE_TABLE_H__*/ diff --git a/src/uart/ui/string_format.cpp b/src/uart/ui/string_format.cpp new file mode 100644 index 0000000..ddfa29f --- /dev/null +++ b/src/uart/ui/string_format.cpp @@ -0,0 +1,569 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "string_format.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std::literals; + +/* This takes a pointer to the end of a buffer + * and fills it backwards towards the front. + * The return value 'q' is a pointer to the start. + * TODO: use std::array for all this. */ +template +static char *to_string_dec_uint_internal( + char *p, + Int n) +{ + *p = 0; + auto q = p; + + do + { + *(--q) = n % 10 + '0'; + n /= 10; + } while (n != 0); + + return q; +} + +static char *to_string_dec_uint_pad_internal( + char *const term, + const uint32_t n, + const int32_t l, + const char fill) +{ + auto q = to_string_dec_uint_internal(term, n); + + // Fill with padding if needed. + // TODO: use std::array instead. There's no + // bounds checks on any of this! + if (fill) + { + while ((term - q) < l) + { + *(--q) = fill; + } + } + + return q; +} + +static char *to_string_dec_uint_internal(uint64_t n, StringFormatBuffer &buffer, size_t &length) +{ + auto end = &buffer.back(); + auto start = to_string_dec_uint_internal(end, n); + length = end - start; + return start; +} + +char *to_string_dec_uint(uint64_t n, StringFormatBuffer &buffer, size_t &length) +{ + return to_string_dec_uint_internal(n, buffer, length); +} + +char *to_string_dec_int(int64_t n, StringFormatBuffer &buffer, size_t &length) +{ + bool negative = n < 0; + auto start = to_string_dec_uint(negative ? -n : n, buffer, length); + + if (negative) + { + *(--start) = '-'; + ++length; + } + + return start; +} + +std::string to_string_dec_int(int64_t n) +{ + StringFormatBuffer b{}; + size_t len{}; + char *str = to_string_dec_int(n, b, len); + return std::string(str, len); +} + +std::string to_string_dec_uint(uint64_t n) +{ + StringFormatBuffer b{}; + size_t len{}; + char *str = to_string_dec_uint(n, b, len); + return std::string(str, len); +} + +std::string to_string_bin( + const uint32_t n, + const uint8_t l) +{ + char p[33]; + for (uint8_t c = 0; c < l; c++) + { + if (n & (1 << (l - 1 - c))) + p[c] = '1'; + else + p[c] = '0'; + } + p[l] = 0; + return p; +} + +std::string to_string_dec_uint( + const uint32_t n, + const int32_t l, + const char fill) +{ + char p[16]; + auto term = p + sizeof(p) - 1; + auto q = to_string_dec_uint_pad_internal(term, n, l, fill); + + // Right justify. + // (This code is redundant and won't do anything if a fill character was specified) + while ((term - q) < l) + { + *(--q) = ' '; + } + + return q; +} + +std::string to_string_dec_int( + const int32_t n, + const int32_t l, + const char fill) +{ + const size_t negative = (n < 0) ? 1 : 0; + uint32_t n_abs = negative ? -n : n; + + char p[16]; + auto term = p + sizeof(p) - 1; + auto q = to_string_dec_uint_pad_internal(term, n_abs, l - negative, fill); + + // Add sign. + if (negative) + { + *(--q) = '-'; + } + + // Right justify. + // (This code is redundant and won't do anything if a fill character was specified) + while ((term - q) < l) + { + *(--q) = ' '; + } + + return q; +} + +std::string to_string_decimal(float decimal, int8_t precision) +{ + double integer_part; + double fractional_part; + + std::string result; + if (precision > 9) + precision = 9; // we will convert to uin32_t, and that is the max it can hold. + + fractional_part = modf(decimal, &integer_part) * pow(10, precision); + + if (fractional_part < 0) + { + fractional_part = -fractional_part; + } + + result = to_string_dec_int(integer_part) + "." + to_string_dec_uint(fractional_part, precision, '0'); + + return result; +} + +std::string to_string_decimal_padding(float decimal, int8_t precision, const int32_t l) +{ + double integer_part; + double fractional_part; + + std::string result; + if (precision > 9) + precision = 9; // we will convert to uin32_t, and that is the max it can hold. + + fractional_part = modf(decimal, &integer_part) * pow(10, precision); + + if (fractional_part < 0) + { + fractional_part = -fractional_part; + } + + result = to_string_dec_int(integer_part) + "." + to_string_dec_uint(fractional_part, precision, '0'); + + // Add padding with spaces to meet the length requirement + if (result.length() < (uint32_t)l) + { + int padding_length = l - result.length(); + std::string padding(padding_length, ' '); + result = padding + result; + } + + return result; +} + +// right-justified frequency in Hz, always 10 characters +std::string to_string_freq(const uint64_t f) +{ + std::string final_str{""}; + + if (f < 1000000) + final_str = to_string_dec_int(f, 10, ' '); + else + final_str = to_string_dec_int(f / 1000000, 4) + to_string_dec_int(f % 1000000, 6, '0'); + + return final_str; +} + +// right-justified frequency in MHz, rounded to 4 decimal places, always 9 characters +std::string to_string_short_freq(const uint64_t f) +{ + auto final_str = to_string_dec_int((f + 50) / 1000000, 4) + "." + to_string_dec_int(((f + 50) / 100) % 10000, 4, '0'); + return final_str; +} + +// non-justified non-padded frequency in MHz, rounded to specified number of decimal places +std::string to_string_rounded_freq(const uint64_t f, int8_t precision) +{ + std::string final_str{""}; + static constexpr uint32_t pow10[7] = { + 1, + 10, + 100, + 1000, + 10000, + 100000, + 1000000, + }; + + if (precision < 1) + { + final_str = to_string_dec_uint(f / 1000000); + } + else + { + if (precision > 6) + precision = 6; + + uint32_t divisor = pow10[6 - precision]; + + final_str = to_string_dec_uint((f + (divisor / 2)) / 1000000) + "." + to_string_dec_int(((f + (divisor / 2)) / divisor) % pow10[precision], precision, '0'); + } + return final_str; +} + +std::string to_string_time_ms(const uint32_t ms) +{ + std::string final_str{""}; + + if (ms < 1000) + { + final_str = to_string_dec_uint(ms) + "ms"; + } + else + { + auto seconds = ms / 1000; + + if (seconds >= 60) + final_str = to_string_dec_uint(seconds / 60) + "m"; + + return final_str + to_string_dec_uint(seconds % 60) + "s"; + } + + return final_str; +} + +static char *to_string_hex_internal(char *ptr, uint64_t value, uint8_t length) +{ + if (length == 0) + return ptr; + + *(--ptr) = uint_to_char(value & 0xF, 16); + return to_string_hex_internal(ptr, value >> 4, length - 1); +} + +std::string to_string_hex(uint64_t value, int32_t length) +{ + constexpr uint8_t buffer_length = 33; + char buffer[buffer_length]; + + char *ptr = &buffer[buffer_length - 1]; + *ptr = '\0'; + + length = std::min(buffer_length - 1, length); + return to_string_hex_internal(ptr, value, length); +} + +std::string to_string_hex_array(uint8_t *array, int32_t length) +{ + std::string str_return; + str_return.reserve(length * 2); + + for (uint8_t i = 0; i < length; i++) + str_return += to_string_hex(array[i], 2); + + return str_return; +} +// TODO: wire standalone api: +/* +std::string to_string_datetime(const rtc::RTC &value, const TimeFormat format) +{ + std::string string{""}; + + if (format == YMDHMS) + { + string += to_string_dec_uint(value.year(), 4) + "-" + + to_string_dec_uint(value.month(), 2, '0') + "-" + + to_string_dec_uint(value.day(), 2, '0') + " "; + } + + string += to_string_dec_uint(value.hour(), 2, '0') + ":" + + to_string_dec_uint(value.minute(), 2, '0'); + + if ((format == YMDHMS) || (format == HMS)) + string += ":" + to_string_dec_uint(value.second(), 2, '0'); + + return string; +} + +std::string to_string_timestamp(const rtc::RTC &value) +{ + return to_string_dec_uint(value.year(), 4, '0') + + to_string_dec_uint(value.month(), 2, '0') + + to_string_dec_uint(value.day(), 2, '0') + + to_string_dec_uint(value.hour(), 2, '0') + + to_string_dec_uint(value.minute(), 2, '0') + + to_string_dec_uint(value.second(), 2, '0'); +} + +std::string to_string_FAT_timestamp(const FATTimestamp ×tamp) +{ + return to_string_dec_uint((timestamp.FAT_date >> 9) + 1980) + "-" + + to_string_dec_uint((timestamp.FAT_date >> 5) & 0xF, 2, '0') + "-" + + to_string_dec_uint((timestamp.FAT_date & 0x1F), 2, '0') + " " + + to_string_dec_uint((timestamp.FAT_time >> 11), 2, '0') + ":" + + to_string_dec_uint((timestamp.FAT_time >> 5) & 0x3F, 2, '0'); +} +*/ +std::string to_string_file_size(uint32_t file_size) +{ + static const std::string suffix[5] = {"B", "kB", "MB", "GB", "??"}; + size_t suffix_index = 0; + + while (file_size >= 1024) + { + file_size /= 1024; + suffix_index++; + } + + if (suffix_index > 4) + suffix_index = 4; + + return to_string_dec_uint(file_size) + suffix[suffix_index]; +} + +std::string to_string_mac_address(const uint8_t *macAddress, uint8_t length, bool noColon) +{ + std::string string; + + string += to_string_hex(macAddress[0], 2); + + for (int i = 1; i < length; i++) + { + string += noColon ? to_string_hex(macAddress[i], 2) : ":" + to_string_hex(macAddress[i], 2); + } + + return string; +} + +std::string to_string_formatted_mac_address(const char *macAddress) +{ + std::string formattedAddress; + + for (int i = 0; i < 12; i += 2) + { + if (i > 0) + { + formattedAddress += ':'; + } + formattedAddress += macAddress[i]; + formattedAddress += macAddress[i + 1]; + } + + return formattedAddress; +} + +void generateRandomMacAddress(char *macAddress) +{ + const char hexDigits[] = "0123456789ABCDEF"; + + // Generate 12 random hexadecimal characters + for (int i = 0; i < 12; i++) + { + int randomIndex = rand() % 16; + macAddress[i] = hexDigits[randomIndex]; + } + macAddress[12] = '\0'; // Null-terminate the string +} + +// TODO: wire standalone api: +/* +uint64_t readUntil(File &file, char *result, std::size_t maxBufferSize, char delimiter) +{ + std::size_t bytesRead = 0; + + while (true) + { + char ch; + File::Result readResult = file.read(&ch, 1); + + if (readResult.is_ok() && readResult.value() > 0) + { + if (ch == delimiter) + { + // Found a space character, stop reading + break; + } + else if (bytesRead < maxBufferSize) + { + // Append the character to the result if there's space + result[bytesRead++] = ch; + } + else + { + // Buffer is full, break to prevent overflow + break; + } + } + else + { + break; // End of file or error + } + } + + // Null-terminate the result string + result[bytesRead] = '\0'; + + return bytesRead; +} +*/ +std::string unit_auto_scale(double n, const uint32_t base_unit, uint32_t precision) +{ + const uint32_t powers_of_ten[5] = {1, 10, 100, 1000, 10000}; + std::string string{""}; + uint32_t prefix_index = base_unit; + double integer_part; + double fractional_part; + + precision = std::min((uint32_t)4, precision); + + while (n > 1000) + { + n /= 1000.0; + prefix_index++; + } + + fractional_part = modf(n, &integer_part) * powers_of_ten[precision]; + if (fractional_part < 0) + fractional_part = -fractional_part; + + string = to_string_dec_int(integer_part); + if (precision) + string += '.' + to_string_dec_uint(fractional_part, precision, '0'); + + if (prefix_index != 3) + string += unit_prefix[prefix_index]; + + return string; +} + +double get_decimals(double num, int16_t mult, bool round) +{ + num -= int(num); // keep decimals only + num *= mult; // Shift decimals into integers + if (!round) + return num; + int16_t intnum = int(num); // Round it up if necessary + num -= intnum; // Get decimal part + if (num > .5) + intnum++; // Round up + return intnum; +} + +static const char *whitespace_str = " \t\r\n"; + +std::string trim(std::string_view str) +{ + auto first = str.find_first_not_of(whitespace_str); + if (first == std::string::npos) + return {}; + + auto last = str.find_last_not_of(whitespace_str); + return std::string{str.substr(first, last - first + 1)}; +} + +std::string trimr(std::string_view str) +{ + size_t last = str.find_last_not_of(whitespace_str); + return std::string{last != std::string::npos ? str.substr(0, last + 1) : ""}; +} + +std::string truncate(std::string_view str, size_t length) +{ + return std::string{str.length() <= length ? str : str.substr(0, length)}; +} + +uint8_t char_to_uint(char c, uint8_t radix) +{ + uint8_t v = 0; + + if (c >= '0' && c <= '9') + v = c - '0'; + else if (c >= 'A' && c <= 'F') + v = c - 'A' + 10; // A is dec: 10 + else if (c >= 'a' && c <= 'f') + v = c - 'a' + 10; // A is dec: 10 + + return v < radix ? v : 0; +} + +char uint_to_char(uint8_t val, uint8_t radix) +{ + if (val >= radix) + return 0; + + if (val < 10) + return '0' + val; + else + return 'A' + val - 10; // A is dec: 10 +} diff --git a/src/uart/ui/string_format.hpp b/src/uart/ui/string_format.hpp new file mode 100644 index 0000000..e2dbb99 --- /dev/null +++ b/src/uart/ui/string_format.hpp @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __STRING_FORMAT_H__ +#define __STRING_FORMAT_H__ + +#include +#include +#include +#include + +// #include "file.hpp" + +// BARF! rtc::RTC is leaking everywhere. +// #include "lpc43xx_cpp.hpp" +// using namespace lpc43xx; + +enum TimeFormat +{ + YMDHMS = 0, + HMS = 1, + HM = 2 +}; + +const char unit_prefix[7]{'n', 'u', 'm', 0, 'k', 'M', 'G'}; + +using StringFormatBuffer = std::array; + +/* Integer conversion without memory allocations. */ +char *to_string_dec_int(int64_t n, StringFormatBuffer &buffer, size_t &length); +char *to_string_dec_uint(uint64_t n, StringFormatBuffer &buffer, size_t &length); + +std::string to_string_dec_int(int64_t n); +std::string to_string_dec_uint(uint64_t n); + +std::string to_string_bin(const uint32_t n, const uint8_t l = 0); +std::string to_string_dec_uint(const uint32_t n, const int32_t l, const char fill = ' '); +std::string to_string_dec_int(const int32_t n, const int32_t l, const char fill = 0); +std::string to_string_decimal(float decimal, int8_t precision); +std::string to_string_decimal_padding(float decimal, int8_t precision, const int32_t l); + +std::string to_string_hex(uint64_t n, int32_t length); +std::string to_string_hex_array(uint8_t *array, int32_t length); + +/* Helper to select length based on type size. */ +template +std::string to_string_hex(T n) +{ + return to_string_hex(n, sizeof(T) * 2); // Two digits/byte. +} + +std::string to_string_freq(const uint64_t f); +std::string to_string_short_freq(const uint64_t f); +std::string to_string_rounded_freq(const uint64_t f, int8_t precision); +std::string to_string_time_ms(const uint32_t ms); + +// TODO: wire standalone api: std::string to_string_datetime(const rtc::RTC &value, const TimeFormat format = YMDHMS); +// TODO: wire standalone api: std::string to_string_timestamp(const rtc::RTC &value); +// TODO: wire standalone api: std::string to_string_FAT_timestamp(const FATTimestamp ×tamp); + +// Gets a human readable file size string. +std::string to_string_file_size(uint32_t file_size); + +// Converts Mac Address to string. +std::string to_string_mac_address(const uint8_t *macAddress, uint8_t length, bool noColon); +std::string to_string_formatted_mac_address(const char *macAddress); +void generateRandomMacAddress(char *macAddress); + +// TODO: wire standalone api: uint64_t readUntil(File &file, char *result, std::size_t maxBufferSize, char delimiter); + +/* Scales 'n' to be a value less than 1000. 'base_unit' is the index of the unit from + * 'unit_prefix' that 'n' is in initially. 3 is the index of the '1s' unit. */ +std::string unit_auto_scale(double n, const uint32_t base_unit, uint32_t precision); +double get_decimals(double num, int16_t mult, bool round = false); + +std::string trim(std::string_view str); // Remove whitespace at ends. +std::string trimr(std::string_view str); // Remove trailing spaces +std::string truncate(std::string_view, size_t length); + +/* Gets the int value for a character given the radix. + * e.g. '5' => 5, 'D' => 13. Out of bounds => 0. */ +uint8_t char_to_uint(char c, uint8_t radix = 10); + +/* Gets the int value for a character given the radix. + * e.g. 5 => '5', 13 => 'D'. Out of bounds => '\0'. */ +char uint_to_char(uint8_t val, uint8_t radix = 10); + +#endif /*__STRING_FORMAT_H__*/ diff --git a/src/uart/ui/theme.cpp b/src/uart/ui/theme.cpp new file mode 100644 index 0000000..f8347e1 --- /dev/null +++ b/src/uart/ui/theme.cpp @@ -0,0 +1,740 @@ + +#include "theme.hpp" + +namespace ui +{ + + ThemeTemplate *Theme::current = nullptr; + + ThemeTemplate *Theme::getInstance() + { + if (current == nullptr) + SetTheme(DefaultGrey); + return Theme::current; + } + + void Theme::SetTheme(ThemeId theme) + { + if (current != nullptr) + delete current; + switch (theme) + { + case Yellow: + current = new ThemeYellow(); + break; + case Aqua: + current = new ThemeAqua(); + break; + case Green: + current = new ThemeGreen(); + break; + case Red: + current = new ThemeRed(); + break; + case DefaultGrey: + default: + current = new ThemeDefault(); + break; + } + } + + ThemeTemplate::~ThemeTemplate() + { + delete bg_lightest; + delete bg_lightest_small; + delete bg_light; + delete bg_medium; + delete bg_dark; + delete bg_darker; + delete bg_darkest; + delete bg_darkest_small; + delete bg_important_small; + delete error_dark; + delete warning_dark; + delete ok_dark; + delete fg_dark; + delete fg_medium; + delete fg_light; + delete fg_red; + delete fg_green; + delete fg_yellow; + delete fg_orange; + delete fg_blue; + delete fg_cyan; + delete fg_darkcyan; + delete fg_magenta; + delete option_active; + delete status_active; // green, the status bar icons when active + delete bg_table_header; + } + + ThemeYellow::ThemeYellow() + { + bg_lightest = new Style{ + .font = font::fixed_8x16(), + .background = {255, 255, 204}, + .foreground = Color::black(), + }; + bg_lightest_small = new Style{ + .font = font::fixed_5x8(), + .background = {255, 255, 204}, + .foreground = Color::black(), + }; + bg_light = new Style{ + .font = font::fixed_8x16(), + .background = {255, 255, 102}, + .foreground = Color::white(), + }; + bg_medium = new Style{ + .font = font::fixed_8x16(), + .background = {204, 204, 0}, + .foreground = Color::white(), + }; + bg_dark = new Style{ + .font = font::fixed_8x16(), + .background = {153, 153, 0}, + .foreground = Color::white(), + }; + bg_darker = new Style{ + .font = font::fixed_8x16(), + .background = {102, 102, 0}, + .foreground = Color::white(), + }; + + bg_darkest = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::white(), + }; + bg_darkest_small = new Style{ + .font = font::fixed_5x8(), + .background = {31, 31, 0}, + .foreground = Color::white(), + }; + + bg_important_small = new Style{ + .font = font::fixed_5x8(), + .background = Color::yellow(), + .foreground = {31, 31, 0}, + }; + + error_dark = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::red(), + }; + warning_dark = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::yellow(), + }; + ok_dark = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::green(), + }; + + fg_dark = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = {153, 153, 0}, + }; + fg_medium = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = {204, 204, 0}, + }; + fg_light = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::light_grey(), + }; + + fg_red = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::red(), + }; + fg_green = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::green(), + }; + fg_yellow = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::yellow(), + }; + fg_orange = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::orange(), + }; + fg_blue = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::blue(), + }; + fg_cyan = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::cyan(), + }; + fg_darkcyan = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::dark_cyan(), + }; + fg_magenta = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::magenta(), + }; + + option_active = new Style{ + .font = font::fixed_8x16(), + .background = Color::orange(), + .foreground = Color::white(), + }; + + status_active = new Color{0, 255, 0}; // green, the status bar icons when active + + bg_table_header = new Color{205, 205, 0}; + } + + ThemeAqua::ThemeAqua() + { + bg_lightest = new Style{ + .font = font::fixed_8x16(), + .background = {204, 255, 255}, + .foreground = Color::black(), + }; + bg_lightest_small = new Style{ + .font = font::fixed_5x8(), + .background = {204, 255, 255}, + .foreground = Color::black(), + }; + bg_light = new Style{ + .font = font::fixed_8x16(), + .background = {102, 255, 255}, + .foreground = Color::white(), + }; + bg_medium = new Style{ + .font = font::fixed_8x16(), + .background = {0, 144, 200}, + .foreground = Color::white(), + }; + bg_dark = new Style{ + .font = font::fixed_8x16(), + .background = {0, 153, 153}, + .foreground = Color::white(), + }; + bg_darker = new Style{ + .font = font::fixed_8x16(), + .background = {0, 102, 102}, + .foreground = Color::white(), + }; + + bg_darkest = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::white(), + }; + bg_darkest_small = new Style{ + .font = font::fixed_5x8(), + .background = {0, 31, 31}, + .foreground = Color::white(), + }; + + bg_important_small = new Style{ + .font = font::fixed_5x8(), + .background = Color::yellow(), + .foreground = {0, 31, 31}, + }; + + error_dark = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::red(), + }; + warning_dark = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::yellow(), + }; + ok_dark = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::green(), + }; + + fg_dark = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = {0, 153, 153}, + }; + fg_medium = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = {0, 204, 204}, + }; + fg_light = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::light_grey(), + }; + + fg_red = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::red(), + }; + fg_green = new Style{ + .font = font::fixed_8x16(), + .background = {31, 31, 0}, + .foreground = Color::green(), + }; + fg_yellow = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::yellow(), + }; + fg_orange = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::orange(), + }; + fg_blue = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::blue(), + }; + fg_cyan = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::cyan(), + }; + fg_darkcyan = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::dark_cyan(), + }; + fg_magenta = new Style{ + .font = font::fixed_8x16(), + .background = {0, 31, 31}, + .foreground = Color::magenta(), + }; + + option_active = new Style{ + .font = font::fixed_8x16(), + .background = Color::blue(), + .foreground = Color::white(), + }; + + status_active = new Color{0, 255, 0}; // green, the status bar icons when active + + bg_table_header = new Color{0, 205, 205}; + } + + ThemeDefault::ThemeDefault() + { + bg_lightest = new Style{ + .font = font::fixed_8x16(), + .background = Color::white(), + .foreground = Color::black(), + }; + bg_lightest_small = new Style{ + .font = font::fixed_5x8(), + .background = Color::white(), + .foreground = Color::black(), + }; + bg_light = new Style{ + .font = font::fixed_8x16(), + .background = Color::light_grey(), + .foreground = Color::white(), + }; + bg_medium = new Style{ + .font = font::fixed_8x16(), + .background = Color::grey(), + .foreground = Color::white(), + }; + bg_dark = new Style{ + .font = font::fixed_8x16(), + .background = Color::dark_grey(), + .foreground = Color::white(), + }; + bg_darker = new Style{ + .font = font::fixed_8x16(), + .background = Color::darker_grey(), + .foreground = Color::white(), + }; + + bg_darkest = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::white(), + }; + bg_darkest_small = new Style{ + .font = font::fixed_5x8(), + .background = Color::black(), + .foreground = Color::white(), + }; + + bg_important_small = new Style{ + .font = font::fixed_5x8(), + .background = Color::yellow(), + .foreground = Color::black(), + }; + + error_dark = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::red(), + }; + warning_dark = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::yellow(), + }; + ok_dark = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::green(), + }; + + fg_dark = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::dark_grey(), + }; + fg_medium = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::grey(), + }; + fg_light = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::light_grey(), + }; + + fg_red = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::red(), + }; + fg_green = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::green(), + }; + fg_yellow = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::yellow(), + }; + fg_orange = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::orange(), + }; + fg_blue = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::blue(), + }; + fg_cyan = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::cyan(), + }; + fg_darkcyan = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::dark_cyan(), + }; + fg_magenta = new Style{ + .font = font::fixed_8x16(), + .background = Color::black(), + .foreground = Color::magenta(), + }; + + option_active = new Style{ + .font = font::fixed_8x16(), + .background = Color::blue(), + .foreground = Color::white(), + }; + + status_active = new Color{0, 255, 0}; // green, the status bar icons when active + bg_table_header = new Color{0, 0, 255}; + } + + ThemeGreen::ThemeGreen() + { + bg_lightest = new Style{ + .font = font::fixed_8x16(), + .background = {0, 245, 29}, + .foreground = Color::black(), + }; + bg_lightest_small = new Style{ + .font = font::fixed_5x8(), + .background = {0, 245, 29}, + .foreground = Color::black(), + }; + bg_light = new Style{ + .font = font::fixed_8x16(), + .background = {0, 212, 25}, + .foreground = Color::white(), + }; + bg_medium = new Style{ + .font = font::fixed_8x16(), + .background = {0, 143, 17}, + .foreground = Color::white(), + }; + bg_dark = new Style{ + .font = font::fixed_8x16(), + .background = {0, 99, 12}, + .foreground = Color::white(), + }; + bg_darker = new Style{ + .font = font::fixed_8x16(), + .background = {0, 79, 9}, + .foreground = Color::white(), + }; + + bg_darkest = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::white(), + }; + bg_darkest_small = new Style{ + .font = font::fixed_5x8(), + .background = {0, 33, 4}, + .foreground = Color::white(), + }; + + bg_important_small = new Style{ + .font = font::fixed_5x8(), + .background = Color::yellow(), + .foreground = {0, 33, 4}, + }; + + error_dark = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::red(), + }; + warning_dark = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::yellow(), + }; + ok_dark = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::green(), + }; + + fg_dark = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = {0, 99, 12}, + }; + fg_medium = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = {0, 143, 17}, + }; + fg_light = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::light_grey(), + }; + + fg_red = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::red(), + }; + fg_green = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::green(), + }; + fg_yellow = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::yellow(), + }; + fg_orange = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::orange(), + }; + fg_blue = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::blue(), + }; + fg_cyan = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::cyan(), + }; + fg_darkcyan = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::dark_cyan(), + }; + fg_magenta = new Style{ + .font = font::fixed_8x16(), + .background = {0, 33, 4}, + .foreground = Color::magenta(), + }; + + option_active = new Style{ + .font = font::fixed_8x16(), + .background = Color::orange(), + .foreground = Color::white(), + }; + + status_active = new Color{0, 255, 0}; // green, the status bar icons when active + + bg_table_header = new Color{0, 205, 30}; + } + + ThemeRed::ThemeRed() + { + bg_lightest = new Style{ + .font = font::fixed_8x16(), + .background = {245, 29, 0}, + .foreground = Color::black(), + }; + bg_lightest_small = new Style{ + .font = font::fixed_5x8(), + .background = {245, 29, 0}, + .foreground = Color::black(), + }; + bg_light = new Style{ + .font = font::fixed_8x16(), + .background = {212, 25, 0}, + .foreground = Color::white(), + }; + bg_medium = new Style{ + .font = font::fixed_8x16(), + .background = {143, 17, 0}, + .foreground = Color::white(), + }; + bg_dark = new Style{ + .font = font::fixed_8x16(), + .background = {99, 12, 0}, + .foreground = Color::white(), + }; + bg_darker = new Style{ + .font = font::fixed_8x16(), + .background = {79, 9, 0}, + .foreground = Color::white(), + }; + + bg_darkest = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::white(), + }; + bg_darkest_small = new Style{ + .font = font::fixed_5x8(), + .background = {33, 4, 0}, + .foreground = Color::white(), + }; + + bg_important_small = new Style{ + .font = font::fixed_5x8(), + .background = Color::yellow(), + .foreground = {33, 4, 0}, + }; + + error_dark = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::red(), + }; + warning_dark = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::yellow(), + }; + ok_dark = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::green(), + }; + + fg_dark = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = {99, 12, 0}, + }; + fg_medium = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = {143, 17, 0}, + }; + fg_light = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::light_grey(), + }; + + fg_red = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::red(), + }; + fg_green = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::green(), + }; + fg_yellow = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::yellow(), + }; + fg_orange = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::orange(), + }; + fg_blue = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::blue(), + }; + fg_cyan = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::cyan(), + }; + fg_darkcyan = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::dark_cyan(), + }; + fg_magenta = new Style{ + .font = font::fixed_8x16(), + .background = {33, 4, 0}, + .foreground = Color::magenta(), + }; + + option_active = new Style{ + .font = font::fixed_8x16(), + .background = Color::orange(), + .foreground = Color::white(), + }; + + status_active = new Color{0, 255, 0}; // green, the status bar icons when active + + bg_table_header = new Color{205, 30, 0}; + } + +} // namespace ui \ No newline at end of file diff --git a/src/uart/ui/theme.hpp b/src/uart/ui/theme.hpp new file mode 100644 index 0000000..da6ccc9 --- /dev/null +++ b/src/uart/ui/theme.hpp @@ -0,0 +1,115 @@ +/* + * Copyright (C) 2024 HTotoo + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __THEME_H__ +#define __THEME_H__ +#include +#include +#include +#include "ui_painter.hpp" +#include "ui_font_fixed_5x8.hpp" +#include "ui_font_fixed_8x16.hpp" + +namespace ui { + +class ThemeTemplate { + public: + ~ThemeTemplate(); + Style* bg_lightest; + Style* bg_lightest_small; + Style* bg_light; + Style* bg_medium; + Style* bg_dark; + Style* bg_darker; + + Style* bg_darkest; + Style* bg_darkest_small; + + Style* bg_important_small; + + Style* error_dark; + Style* warning_dark; + Style* ok_dark; + + Style* fg_dark; + Style* fg_medium; + Style* fg_light; + + Style* fg_red; + Style* fg_green; + Style* fg_yellow; + Style* fg_orange; + Style* fg_blue; + Style* fg_cyan; + Style* fg_darkcyan; + Style* fg_magenta; + + Style* option_active; + + Color* status_active; // green, the status bar icons when active + Color* bg_table_header; +}; + +class ThemeDefault : public ThemeTemplate { + public: + ThemeDefault(); +}; + +class ThemeYellow : public ThemeTemplate { + public: + ThemeYellow(); +}; + +class ThemeAqua : public ThemeTemplate { + public: + ThemeAqua(); +}; + +class ThemeGreen : public ThemeTemplate { + public: + ThemeGreen(); +}; + +class ThemeRed : public ThemeTemplate { + public: + ThemeRed(); +}; + +class Theme { + public: + enum ThemeId { + DefaultGrey = 0, + Yellow = 1, + Aqua = 2, + Green = 3, + Red = 4, + MAX + }; + static ThemeTemplate* getInstance(); + + static void SetTheme(ThemeId theme); + static ThemeTemplate* current; + + private: +}; + +} // namespace ui +#endif /*__THEME_H__*/ diff --git a/src/uart/ui/ui.cpp b/src/uart/ui/ui.cpp new file mode 100644 index 0000000..7ec4b9d --- /dev/null +++ b/src/uart/ui/ui.cpp @@ -0,0 +1,132 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "ui.hpp" +// #include "irq_controls.hpp" +#include "sine_table.hpp" +#include "utility.hpp" + +#include + +namespace ui +{ + + // CGA palette + // Index into this table should match STR_COLOR_ escape string in ui.hpp + Color term_colors[16] = { + Color::black(), + Color::dark_blue(), + Color::dark_green(), + Color::dark_cyan(), + Color::dark_red(), + Color::dark_magenta(), + Color::dark_yellow(), + Color::light_grey(), + Color::dark_grey(), + Color::blue(), + Color::green(), + Color::cyan(), + Color::red(), + Color::magenta(), + Color::yellow(), + Color::white()}; + + bool Rect::contains(const Point p) const + { + return (p.x() >= left()) && (p.y() >= top()) && + (p.x() < right()) && (p.y() < bottom()); + } + + Rect Rect::intersect(const Rect &o) const + { + const auto x1 = std::max(left(), o.left()); + const auto x2 = std::min(right(), o.right()); + const auto y1 = std::max(top(), o.top()); + const auto y2 = std::min(bottom(), o.bottom()); + if ((x2 >= x1) && (y2 > y1)) + { + return {x1, y1, x2 - x1, y2 - y1}; + } + else + { + return {}; + } + } + + // TODO: This violates the principle of least surprise! + // This does a union, but that might not be obvious from "+=" syntax. + Rect &Rect::operator+=(const Rect &p) + { + if (is_empty()) + { + *this = p; + } + if (!p.is_empty()) + { + const auto x1 = std::min(left(), p.left()); + const auto y1 = std::min(top(), p.top()); + _pos = {x1, y1}; + const auto x2 = std::max(right(), p.right()); + const auto y2 = std::max(bottom(), p.bottom()); + _size = {x2 - x1, y2 - y1}; + } + return *this; + } + + Rect &Rect::operator+=(const Point &p) + { + _pos += p; + return *this; + } + + Rect &Rect::operator-=(const Point &p) + { + _pos -= p; + return *this; + } + + Point polar_to_point(float angle, uint32_t distance) + { + // polar to compass with y negated for screen drawing + return Point(sin_f32(DEG_TO_RAD(-angle) + pi) * distance, + sin_f32(DEG_TO_RAD(-angle) - (pi / 2)) * distance); + } + + Point fast_polar_to_point(int32_t angle, uint32_t distance) + { + // polar to compass with y negated for screen drawing + return Point((int16_sin_s4(((1 << 16) * (-angle + 180)) / 360) * distance) / (1 << 16), + (int16_sin_s4(((1 << 16) * (-angle - 90)) / 360) * distance) / (1 << 16)); + } + + bool key_is_long_pressed(KeyEvent key) + { + if (key < KeyEvent::Back) + { + // TODO: this would make more sense as a flag on KeyEvent + // passed up to the UI via event dispatch. + return false; // TODO: wire standalone api: switch_is_long_pressed(static_cast(key)); + } + + return false; + } + +} /* namespace ui */ diff --git a/src/uart/ui/ui.hpp b/src/uart/ui/ui.hpp new file mode 100644 index 0000000..36a7b83 --- /dev/null +++ b/src/uart/ui/ui.hpp @@ -0,0 +1,410 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __UI_H__ +#define __UI_H__ + +#include + +namespace ui { + +// Escape sequences for colored text; second character is index into term_colors[] +#define STR_COLOR_BLACK "\x1B\x00" +#define STR_COLOR_DARK_BLUE "\x1B\x01" +#define STR_COLOR_DARK_GREEN "\x1B\x02" +#define STR_COLOR_DARK_CYAN "\x1B\x03" +#define STR_COLOR_DARK_RED "\x1B\x04" +#define STR_COLOR_DARK_MAGENTA "\x1B\x05" +#define STR_COLOR_DARK_YELLOW "\x1B\x06" +#define STR_COLOR_LIGHT_GREY "\x1B\x07" +#define STR_COLOR_DARK_GREY "\x1B\x08" +#define STR_COLOR_BLUE "\x1B\x09" +#define STR_COLOR_GREEN "\x1B\x0A" +#define STR_COLOR_CYAN "\x1B\x0B" +#define STR_COLOR_RED "\x1B\x0C" +#define STR_COLOR_MAGENTA "\x1B\x0D" +#define STR_COLOR_YELLOW "\x1B\x0E" +#define STR_COLOR_WHITE "\x1B\x0F" +#define STR_COLOR_FOREGROUND "\x1B\x10" + +#define DEG_TO_RAD(d) (d * (2 * pi) / 360.0) + +using Coord = int16_t; +using Dim = int16_t; + +constexpr uint16_t screen_width = 240; +constexpr uint16_t screen_height = 320; + +/* Dimensions for the default font character. */ +constexpr uint16_t char_width = 8; +constexpr uint16_t char_height = 16; + +struct Color { + uint16_t v; // rrrrrGGGGGGbbbbb + + constexpr Color() + : v{0} { + } + + constexpr Color( + uint16_t v) + : v{v} { + } + + constexpr Color( + uint8_t r, + uint8_t g, + uint8_t b) + : v{ + static_cast( + ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | ((b & 0xf8) >> 3))} { + } + + uint8_t r() { + return (uint8_t)((v >> 8) & 0xf8); + } + + uint8_t g() { + return (uint8_t)((v >> 3) & 0xfc); + } + + uint8_t b() { + return (uint8_t)((v << 3) & 0xf8); + } + + uint8_t to_greyscale() { + uint32_t r = (v >> 8) & 0xf8; + uint32_t g = (v >> 3) & 0xfc; + uint32_t b = (v << 3) & 0xf8; + + uint32_t grey = ((r * 306) + (g * 601) + (b * 117)) >> 10; + + return (uint8_t)grey; + } + + uint16_t dark() { + // stripping bits 4 & 5 from each of the colors R/G/B + return (v & ((0xc8 << 8) | (0xcc << 3) | (0xc8 >> 3))); + } + + Color operator-() const { + return (v ^ 0xffff); + } + + /* Converts a 32-bit color into a 16-bit color. + * High byte is ignored. */ + static constexpr Color RGB(uint32_t rgb) { + return {static_cast((rgb >> 16) & 0xff), + static_cast((rgb >> 8) & 0xff), + static_cast(rgb & 0xff)}; + } + + static constexpr Color black() { + return {0, 0, 0}; + } + + static constexpr Color red() { + return {255, 0, 0}; + } + static constexpr Color dark_red() { + return {159, 0, 0}; + } + + static constexpr Color orange() { + return {255, 175, 0}; + } + static constexpr Color dark_orange() { + return {191, 95, 0}; + } + + static constexpr Color yellow() { + return {255, 255, 0}; + } + static constexpr Color dark_yellow() { + return {191, 191, 0}; + } + + static constexpr Color green() { + return {0, 255, 0}; + } + static constexpr Color dark_green() { + return {0, 159, 0}; + } + + static constexpr Color blue() { + return {0, 0, 255}; + } + static constexpr Color dark_blue() { + return {0, 0, 191}; + } + + static constexpr Color cyan() { + return {0, 255, 255}; + } + static constexpr Color dark_cyan() { + return {0, 191, 191}; + } + + static constexpr Color magenta() { + return {255, 0, 255}; + } + static constexpr Color dark_magenta() { + return {191, 0, 191}; + } + + static constexpr Color white() { + return {255, 255, 255}; + } + + static constexpr Color light_grey() { + return {191, 191, 191}; + } + static constexpr Color grey() { + return {127, 127, 127}; + } + static constexpr Color dark_grey() { + return {63, 63, 63}; + } + static constexpr Color darker_grey() { + return {31, 31, 31}; + } + + static constexpr Color purple() { + return {204, 0, 102}; + } +}; + +extern Color term_colors[16]; + +struct ColorRGB888 { + uint8_t r; + uint8_t g; + uint8_t b; +}; + +struct Point { + private: + Coord _x; + Coord _y; + + public: + constexpr Point() + : _x{0}, + _y{0} { + } + + constexpr Point( + int x, + int y) + : _x{static_cast(x)}, + _y{static_cast(y)} { + } + + constexpr int x() const { + return _x; + } + + constexpr int y() const { + return _y; + } + + constexpr Point operator-() const { + return {-_x, -_y}; + } + + constexpr Point operator+(const Point& p) const { + return {_x + p._x, _y + p._y}; + } + + constexpr Point operator-(const Point& p) const { + return {_x - p._x, _y - p._y}; + } + + Point& operator+=(const Point& p) { + _x += p._x; + _y += p._y; + return *this; + } + + Point& operator-=(const Point& p) { + _x -= p._x; + _y -= p._y; + return *this; + } +}; + +struct Size { + private: + Dim _w; + Dim _h; + + public: + constexpr Size() + : _w{0}, + _h{0} { + } + + constexpr Size( + int w, + int h) + : _w{static_cast(w)}, + _h{static_cast(h)} { + } + + int width() const { + return _w; + } + + int height() const { + return _h; + } + + bool is_empty() const { + return (_w < 1) || (_h < 1); + } +}; + +struct Rect { + private: + Point _pos; + Size _size; + + public: + constexpr Rect() + : _pos{}, + _size{} { + } + + constexpr Rect( + int x, + int y, + int w, + int h) + : _pos{x, y}, + _size{w, h} { + } + + constexpr Rect( + Point pos, + Size size) + : _pos(pos), + _size(size) { + } + + Point location() const { + return _pos; + } + + Size size() const { + return _size; + } + + int top() const { + return _pos.y(); + } + + int bottom() const { + return _pos.y() + _size.height(); + } + + int left() const { + return _pos.x(); + } + + int right() const { + return _pos.x() + _size.width(); + } + + int width() const { + return _size.width(); + } + + int height() const { + return _size.height(); + } + + Point center() const { + return {_pos.x() + _size.width() / 2, _pos.y() + _size.height() / 2}; + } + + bool is_empty() const { + return _size.is_empty(); + } + + bool contains(const Point p) const; + + Rect intersect(const Rect& o) const; + + Rect operator+(const Point& p) const { + return {_pos + p, _size}; + } + + Rect& operator+=(const Rect& p); + Rect& operator+=(const Point& p); + Rect& operator-=(const Point& p); + + operator bool() const { + return !_size.is_empty(); + } +}; + +struct Bitmap { + const Size size; + const uint8_t* const data; +}; + +enum class KeyEvent : uint8_t { + /* Ordinals map to bit positions reported by CPLD */ + Right = 0, + Left = 1, + Down = 2, + Up = 3, + Select = 4, + Dfu = 5, + Back = 6, /* Left and Up together */ +}; + +using EncoderEvent = int32_t; +using KeyboardEvent = uint8_t; + +struct TouchEvent { + enum class Type : uint32_t { + Start = 0, + Move = 1, + End = 2, + }; + + Point point; + Type type; +}; + +Point polar_to_point(float angle, uint32_t distance); + +Point fast_polar_to_point(int32_t angle, uint32_t distance); + +/* Default font glyph size. */ +constexpr Size char_size{char_width, char_height}; + +bool key_is_long_pressed(KeyEvent key); + +} /* namespace ui */ + +#endif /*__UI_H__*/ diff --git a/src/uart/ui/ui_focus.cpp b/src/uart/ui/ui_focus.cpp new file mode 100644 index 0000000..c8015a7 --- /dev/null +++ b/src/uart/ui/ui_focus.cpp @@ -0,0 +1,211 @@ +/* + * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. + * Copyright (C) 2016 Furrtek + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "ui_focus.hpp" +#include "ui_widget.hpp" + +#include + +#include +#include +#include +#include + +#define pow2(x) ((x) * (x)) + +namespace ui { + +Widget* FocusManager::focus_widget() const { + return focus_widget_; +} + +void FocusManager::set_focus_widget(Widget* const new_focus_widget) { + // Widget already has focus. + if (new_focus_widget == focus_widget()) { + return; + } + + if (new_focus_widget) { + if (!new_focus_widget->focusable()) + return; + } + + // Blur old widget. + // NB: This will crash if the focus_widget is a destroyed instance. + if (focus_widget()) { + focus_widget()->on_blur(); + focus_widget()->set_dirty(); + } + + focus_widget_ = new_focus_widget; + + if (focus_widget()) { + focus_widget()->on_focus(); + focus_widget()->set_dirty(); + } +} + +using test_result_t = std::pair; +using test_fn = std::function; +using test_collection_t = std::vector; + +/* Walk all visible widgets in hierarchy, collecting those that pass test */ +template +static void widget_collect_visible(Widget* const w, TestFn test, test_collection_t& collection) { + for (auto child : w->children()) { + if (!child->hidden()) { + const auto result = test(child); + if (result.first) { + collection.push_back(result); + } + widget_collect_visible(child, test, collection); + } + } +} + +static int32_t rect_distances( + const KeyEvent direction, + const Rect& rect_start, + const Rect& rect_end) { + Coord on_axis_max, on_axis_min; + + switch (direction) { + case KeyEvent::Right: + on_axis_max = rect_end.left(); + on_axis_min = rect_start.right(); + break; + + case KeyEvent::Left: + on_axis_max = rect_start.left(); + on_axis_min = rect_end.right(); + break; + + case KeyEvent::Down: + on_axis_max = rect_end.top(); + on_axis_min = rect_start.bottom(); + break; + + case KeyEvent::Up: + on_axis_max = rect_start.top(); + on_axis_min = rect_end.bottom(); + break; + + default: + return -1; + } + + Coord on_axis_distance = on_axis_max - on_axis_min; + if (on_axis_distance < 0) { + return -1; + } + + Coord perpendicular_axis_start, perpendicular_axis_end; + + switch (direction) { + case KeyEvent::Right: + case KeyEvent::Left: + perpendicular_axis_start = rect_start.center().y(); + perpendicular_axis_end = rect_end.center().y(); + break; + + case KeyEvent::Up: + case KeyEvent::Down: + perpendicular_axis_start = rect_start.center().x(); + perpendicular_axis_end = rect_end.center().x(); + break; + + default: + return -1; + } + + switch (direction) { + case KeyEvent::Right: + case KeyEvent::Left: + return pow2(std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) * (on_axis_distance + 1); + break; + + case KeyEvent::Up: + case KeyEvent::Down: + return (std::abs(perpendicular_axis_end - perpendicular_axis_start) + 1) * pow2(on_axis_distance + 1); + break; + + default: + return 0; + } +} + +void FocusManager::update( + Widget* const top_widget, + const KeyEvent event) { + if (focus_widget()) { + const auto focus_screen_rect = focus_widget()->screen_rect(); + + const auto test_fn = [&focus_screen_rect, event](ui::Widget* const w) -> test_result_t { + // if( w->visible() && w->focusable() ) { + if (w->focusable()) { + const auto distance = rect_distances(event, focus_screen_rect, w->screen_rect()); + if (distance >= 0) { + return {w, distance}; + } + } + + return {nullptr, 0}; + }; + + const auto find_back_fn = [](ui::Widget* const w) -> test_result_t { + if (w->focusable() && (w->id == -1)) + return {w, 0}; + else + return {nullptr, 0}; + }; + + test_collection_t collection; + widget_collect_visible(top_widget, test_fn, collection); + + const auto compare_fn = [](const test_result_t& a, const test_result_t& b) { + return a.second < b.second; + }; + + const auto nearest = std::min_element(collection.cbegin(), collection.cend(), compare_fn); + // Up and left to indicate back + if (event == KeyEvent::Back) { + collection.clear(); + widget_collect_visible(top_widget, find_back_fn, collection); + if (!collection.empty()) + set_focus_widget(collection[0].first); + } else if (nearest != collection.cend()) { + // focus->blur(); + const auto new_focus = (*nearest).first; + set_focus_widget(new_focus); + } else { + if ((focus_widget()->id >= 0) && (event == KeyEvent::Left)) { + // Stuck left, move to back button + collection.clear(); + widget_collect_visible(top_widget, find_back_fn, collection); + if (!collection.empty()) + set_focus_widget(collection[0].first); + } + } + } +} + +} /* namespace ui */ diff --git a/src/uart/ui/ui_focus.hpp b/src/uart/ui/ui_focus.hpp new file mode 100644 index 0000000..2f9c456 --- /dev/null +++ b/src/uart/ui/ui_focus.hpp @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2015 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __UI_FOCUS_H__ +#define __UI_FOCUS_H__ + +#include "ui.hpp" + +namespace ui { + +class Widget; + +class FocusManager { + public: + Widget* focus_widget() const; + void set_focus_widget(Widget* const new_focus_widget); + + void update(Widget* const top_widget, const KeyEvent event); + // void update(Widget* const top_widget, const TouchEvent event); + + private: + Widget* focus_widget_{nullptr}; +}; + +} /* namespace ui */ + +#endif /*__UI_FOCUS_H__*/ diff --git a/src/uart/ui/ui_font_fixed_5x8.cpp b/src/uart/ui/ui_font_fixed_5x8.cpp new file mode 100644 index 0000000..d246077 --- /dev/null +++ b/src/uart/ui/ui_font_fixed_5x8.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2023 Kyle Reed + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "ui_font_fixed_5x8.hpp" + +#include + +#include "standalone_application.hpp" + +namespace ui +{ + namespace font + { + ui::Font *fixed_5x8_font = nullptr; + + ui::Font &fixed_5x8() + { + if (fixed_5x8_font == nullptr) + { + fixed_5x8_font = new ui::Font{ + 5, + 8, + _api->fixed_5x8_glyph_data, + 0x20, + 95, + }; + } + + return *fixed_5x8_font; + } + + } /* namespace font */ +} /* namespace ui */ diff --git a/src/uart/ui/ui_font_fixed_5x8.hpp b/src/uart/ui/ui_font_fixed_5x8.hpp new file mode 100644 index 0000000..3709378 --- /dev/null +++ b/src/uart/ui/ui_font_fixed_5x8.hpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2023 Kyle Reed + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __UI_FONT_FIXED_5X8_H__ +#define __UI_FONT_FIXED_5X8_H__ + +#include "ui_text.hpp" + +namespace ui +{ + namespace font + { + extern ui::Font &fixed_5x8(); + + } // namespace font +} // namespace ui + +#endif /*__UI_FONT_FIXED_5X8_H__*/ diff --git a/src/uart/ui/ui_font_fixed_8x16.cpp b/src/uart/ui/ui_font_fixed_8x16.cpp new file mode 100644 index 0000000..9ddb685 --- /dev/null +++ b/src/uart/ui/ui_font_fixed_8x16.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "ui_font_fixed_8x16.hpp" + +#include + +#include "standalone_application.hpp" + +namespace ui +{ + namespace font + { + ui::Font *fixed_8x16_font = nullptr; + + ui::Font &fixed_8x16() + { + if (fixed_8x16_font == nullptr) + { + fixed_8x16_font = new ui::Font{ + 8, + 16, + _api->fixed_8x16_glyph_data, + 0x20, + 223, + }; + } + + return *fixed_8x16_font; + } + + } /* namespace font */ +} /* namespace ui */ diff --git a/src/uart/ui/ui_font_fixed_8x16.hpp b/src/uart/ui/ui_font_fixed_8x16.hpp new file mode 100644 index 0000000..b08241e --- /dev/null +++ b/src/uart/ui/ui_font_fixed_8x16.hpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __UI_FONT_FIXED_8X16_H__ +#define __UI_FONT_FIXED_8X16_H__ + +#include "ui_text.hpp" + +namespace ui +{ + namespace font + { + extern ui::Font &fixed_8x16(); + + } /* namespace font */ +} // namespace ui + +#endif /*__UI_FONT_FIXED_8X16_H__*/ diff --git a/src/uart/ui/ui_painter.cpp b/src/uart/ui/ui_painter.cpp new file mode 100644 index 0000000..0e2e019 --- /dev/null +++ b/src/uart/ui/ui_painter.cpp @@ -0,0 +1,173 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "ui_painter.hpp" +#include "ui_widget.hpp" +// #include "portapack.hpp" +#include "standalone_application.hpp" + +// using namespace portapack; + +namespace ui +{ + + Style Style::invert() const + { + return { + .font = font, + .background = foreground, + .foreground = background}; + } + + int Painter::draw_char(Point p, const Style &style, char c) + { + const auto glyph = style.font.glyph(c); + _api->draw_bitmap(p.x(), p.y(), glyph.size().width(), glyph.size().height(), glyph.pixels(), style.foreground.v, style.background.v); + return glyph.advance().x(); + } + + int Painter::draw_string(Point p, const Style &style, std::string_view text) + { + return draw_string(p, style.font, style.foreground, style.background, text); + } + + int Painter::draw_string( + Point p, + const Font &font, + Color foreground, + Color background, + std::string_view text) + { + bool escape = false; + size_t width = 0; + Color pen = foreground; + + for (auto c : text) + { + if (escape) + { + if (c < std::size(term_colors)) + pen = term_colors[(uint8_t)c]; + else + pen = foreground; + escape = false; + } + else + { + if (c == '\x1B') + { + escape = true; + } + else + { + const auto glyph = font.glyph(c); + _api->draw_bitmap(p.x(), p.y(), glyph.size().width(), glyph.size().height(), glyph.pixels(), pen.v, background.v); + const auto advance = glyph.advance(); + p += advance; + width += advance.x(); + } + } + } + + return width; + } + + void Painter::draw_bitmap(Point p, const Bitmap &bitmap, Color foreground, Color background) + { + // If bright foreground colors on white background, darken the foreground color to improve visibility + if ((background.v == ui::Color::white().v) && (foreground.to_greyscale() > 146)) + foreground = foreground.dark(); + + _api->draw_bitmap(p.x(), p.y(), bitmap.size.width(), bitmap.size.height(), bitmap.data, foreground.v, background.v); + } + + void Painter::draw_hline(Point p, int width, Color c) + { + _api->fill_rectangle(p.x(), p.y(), width, 1, c.v); + } + + void Painter::draw_vline(Point p, int height, Color c) + { + _api->fill_rectangle(p.x(), p.y(), 1, height, c.v); + } + + void Painter::draw_rectangle(Rect r, Color c) + { + draw_hline(r.location(), r.width(), c); + draw_vline({r.left(), r.top() + 1}, r.height() - 2, c); + draw_vline({r.left() + r.width() - 1, r.top() + 1}, r.height() - 2, c); + draw_hline({r.left(), r.top() + r.height() - 1}, r.width(), c); + } + + void Painter::fill_rectangle(Rect r, Color c) + { + _api->fill_rectangle(r.left(), r.top(), r.width(), r.height(), c.v); + } + + void Painter::fill_rectangle_unrolled8(Rect r, Color c) + { + _api->fill_rectangle_unrolled8(r.left(), r.top(), r.width(), r.height(), c.v); + } + + void Painter::paint_widget_tree(Widget *w) + { + if (ui::is_dirty()) + { + paint_widget(w); + ui::dirty_clear(); + } + } + + void Painter::paint_widget(Widget *w) + { + if (w->hidden()) + { + // Mark widget (and all children) as invisible. + w->visible(false); + } + else + { + // Mark this widget as visible and recurse. + w->visible(true); + + if (w->dirty()) + { + w->paint(*this); + // Force-paint all children. + for (const auto child : w->children()) + { + child->set_dirty(); + paint_widget(child); + } + w->set_clean(); + } + else + { + // Selectively paint all children. + for (const auto child : w->children()) + { + paint_widget(child); + } + } + } + } + +} /* namespace ui */ diff --git a/src/uart/ui/ui_painter.hpp b/src/uart/ui/ui_painter.hpp new file mode 100644 index 0000000..5343826 --- /dev/null +++ b/src/uart/ui/ui_painter.hpp @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __UI_PAINTER_H__ +#define __UI_PAINTER_H__ + +#include "ui.hpp" +#include "ui_text.hpp" + +#include + +namespace ui { + +struct Style { + const Font& font; + const Color background; + const Color foreground; + + Style invert() const; +}; + +/* Sometimes mutation is just the more readable thing... */ +struct MutableStyle { + const Font* font; + Color background; + Color foreground; + + MutableStyle(const Style& s) + : font{&s.font}, + background{s.background}, + foreground{s.foreground} {} + + void invert() { + std::swap(background, foreground); + } + + operator Style() const { + return { + .font = *font, + .background = background, + .foreground = foreground}; + } +}; + +class Widget; + +class Painter { + public: + Painter(){}; + + Painter(const Painter&) = delete; + Painter(Painter&&) = delete; + + int draw_char(Point p, const Style& style, char c); + + int draw_string(Point p, const Style& style, std::string_view text); + int draw_string(Point p, const Font& font, Color foreground, Color background, std::string_view text); + + void draw_bitmap(Point p, const Bitmap& bitmap, Color background, Color foreground); + + void draw_rectangle(Rect r, Color c); + void fill_rectangle(Rect r, Color c); + void fill_rectangle_unrolled8(Rect r, Color c); + + void paint_widget_tree(Widget* w); + + void draw_hline(Point p, int width, Color c); + void draw_vline(Point p, int height, Color c); + + private: + void paint_widget(Widget* w); +}; + +} /* namespace ui */ + +#endif /*__UI_PAINTER_H__*/ diff --git a/src/uart/ui/ui_text.cpp b/src/uart/ui/ui_text.cpp new file mode 100644 index 0000000..77428f5 --- /dev/null +++ b/src/uart/ui/ui_text.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "ui_text.hpp" + +namespace ui { + +Glyph Font::glyph(const char c) const { + size_t index; + + if (c < c_start) { + // Non-display C0 Control characters - map to blank (index 0) + return {w, h, data}; + } + + // Handle gap in glyphs table for C1 Control characters 0x80-0x9F + if (c < C1_CONTROL_CHARS_START) { + // ASCII chars <0x80: + index = c - c_start; + } else if (c >= C1_CONTROL_CHARS_START + C1_CONTROL_CHARS_COUNT) { + // Latin 1 chars 0xA0-0xFF + index = c - c_start - C1_CONTROL_CHARS_COUNT; + } else { + // C1 Control characters - map to blank + return {w, h, data}; + } + + if (index >= c_count) { // Latin Extended characters > 0xFF - not supported + return {w, h, data}; + } else { + return {w, h, &data[index * data_stride]}; + } +} + +Dim Font::line_height() const { + return h; +} + +Dim Font::char_width() const { + return w; +} + +Size Font::size_of(const std::string s) const { + Size size; + + for (const auto c : s) { + const auto glyph_data = glyph(c); + size = { + size.width() + glyph_data.w(), + std::max(size.height(), glyph_data.h())}; + } + + return size; +} + +} /* namespace ui */ diff --git a/src/uart/ui/ui_text.hpp b/src/uart/ui/ui_text.hpp new file mode 100644 index 0000000..123da53 --- /dev/null +++ b/src/uart/ui/ui_text.hpp @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#ifndef __UI_TEXT_H__ +#define __UI_TEXT_H__ + +#include +#include +#include + +#include "ui.hpp" + +// C1 Control Characters are an unprintable range of glyphs missing from the font files +#define C1_CONTROL_CHARS_START 0x80 +#define C1_CONTROL_CHARS_COUNT 32 + +namespace ui { + +class Glyph { + public: + constexpr Glyph( + Dim w, + Dim h, + const uint8_t* const pixels) + : w_{static_cast(w)}, + h_{static_cast(h)}, + pixels_{pixels} { + } + + int w() const { + return w_; + } + + int h() const { + return h_; + } + + Size size() const { + return {w_, h_}; + } + + Point advance() const { + return {w_, 0}; + } + + const uint8_t* pixels() const { + return pixels_; + } + + private: + const uint8_t w_; + const uint8_t h_; + const uint8_t* const pixels_; +}; + +class Font { + public: + constexpr Font( + Dim w, + Dim h, + const uint8_t* data, + char c_start, + size_t c_count) + : w{w}, + h{h}, + data{data}, + c_start{c_start}, + c_count{c_count}, + data_stride{(w * h + 7U) >> 3} { + } + + Glyph glyph(const char c) const; + + Dim line_height() const; + Dim char_width() const; + + Size size_of(const std::string s) const; + + private: + const Dim w; + const Dim h; + const uint8_t* const data; + const char c_start; + const size_t c_count; + const size_t data_stride; +}; + +} /* namespace ui */ + +#endif /*__UI_TEXT_H__*/ diff --git a/src/uart/ui/ui_widget.cpp b/src/uart/ui/ui_widget.cpp new file mode 100644 index 0000000..1c8966f --- /dev/null +++ b/src/uart/ui/ui_widget.cpp @@ -0,0 +1,3310 @@ +/* + * Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc. + * Copyright (C) 2016 Furrtek + * + * This file is part of PortaPack. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, + * Boston, MA 02110-1301, USA. + */ + +#include "ui_widget.hpp" +#include "ui_painter.hpp" +// #include "portapack.hpp" +#include "standalone_application.hpp" + +#include +#include +#include + +// #include "chprintf.h" +// #include "irq_controls.hpp" +#include "string_format.hpp" +// #include "usb_serial_device_to_host.h" +// #include "rtc_time.hpp" +// #include "battery.hpp" + +// using namespace portapack; +// using namespace rtc_time; + +namespace ui +{ + + static bool ui_dirty = true; + + void dirty_set() + { + _api->set_dirty(); + ui_dirty = true; + } + + void dirty_clear() + { + ui_dirty = false; + } + + bool is_dirty() + { + return ui_dirty; + } + + /* Widget ****************************************************************/ + + const std::vector Widget::no_children{}; + + Point Widget::screen_pos() + { + return screen_rect().location(); + } + + Size Widget::size() const + { + return _parent_rect.size(); + } + + Rect Widget::screen_rect() const + { + return parent() ? (parent_rect() + parent()->screen_pos()) : parent_rect(); + } + + Rect Widget::parent_rect() const + { + return _parent_rect; + } + + void Widget::set_parent_rect(const Rect new_parent_rect) + { + _parent_rect = new_parent_rect; + set_dirty(); + } + + Widget *Widget::parent() const + { + return parent_; + } + + void Widget::set_parent(Widget *const widget) + { + if (widget == parent_) + { + return; + } + + if (parent_ && !widget) + { + // We have a parent, but are losing it. Update visible status. + dirty_overlapping_children_in_rect(screen_rect()); + visible(false); + } + + parent_ = widget; + + set_dirty(); + } + + void Widget::set_dirty() + { + flags.dirty = true; + dirty_set(); + } + + bool Widget::dirty() const + { + return flags.dirty; + } + + void Widget::set_clean() + { + flags.dirty = false; + } + + void Widget::hidden(bool hide) + { + if (hide != flags.hidden) + { + flags.hidden = hide; + + // If parent is hidden, either of these is a no-op. + if (hide) + { + // TODO: Instead of dirtying parent entirely, dirty only children + // that overlap with this widget. + + // parent()->dirty_overlapping_children_in_rect(parent_rect()); + + /* TODO: Notify self and all non-hidden children that they're + * now effectively hidden? + */ + } + else + { + set_dirty(); + /* TODO: Notify self and all non-hidden children that they're + * now effectively shown? + */ + } + } + } + + void Widget::focus() + { + context().focus_manager().set_focus_widget(this); + } + + void Widget::on_focus() + { + } + + void Widget::blur() + { + context().focus_manager().set_focus_widget(nullptr); + } + + void Widget::on_blur() + { + } + + bool Widget::focusable() const + { + return flags.focusable; + } + + void Widget::set_focusable(const bool value) + { + flags.focusable = value; + } + + bool Widget::has_focus() + { + return (context().focus_manager().focus_widget() == this); + } + + bool Widget::on_key(const KeyEvent event) + { + (void)event; + return false; + } + + bool Widget::on_encoder(const EncoderEvent event) + { + (void)event; + return false; + } + + bool Widget::on_touch(const TouchEvent event) + { + (void)event; + return false; + } + bool Widget::on_keyboard(const KeyboardEvent event) + { + (void)event; + return false; + } + + const std::vector &Widget::children() const + { + return no_children; + } + + Context &Widget::context() const + { + if (parent_ == nullptr) + _api->panic("parent__ is null"); + + return parent()->context(); + } + + void Widget::set_style(const Style *new_style) + { + if (new_style != style_) + { + style_ = new_style; + set_dirty(); + } + } + + const Style &Widget::style() const + { + if (style_ != nullptr) + return *style_; + else + { + auto p = parent(); + if (p == nullptr) + // TODO: debug + while (true) + ; + return p->style(); + } + } + + void Widget::visible(bool v) + { + if (v != flags.visible) + { + flags.visible = v; + + /* TODO: This on_show/on_hide implementation seems inelegant. + * But I need *some* way to take/configure resources when + * a widget becomes visible, and reverse the process when the + * widget becomes invisible, whether the widget (or parent) is + * hidden, or the widget (or parent) is removed from the tree. + */ + if (v) + { + on_show(); + } + else + { + on_hide(); + + // Set all children invisible too. + for (const auto child : children()) + { + child->visible(false); + } + } + } + } + + bool Widget::highlighted() const + { + return flags.highlighted; + } + + void Widget::set_highlighted(const bool value) + { + flags.highlighted = value; + } + + void Widget::dirty_overlapping_children_in_rect(const Rect &child_rect) + { + for (auto child : children()) + { + if (!child_rect.intersect(child->parent_rect()).is_empty()) + { + child->set_dirty(); + } + } + } + + void Widget::getAccessibilityText(std::string &result) + { + result = ""; + } + void Widget::getWidgetName(std::string &result) + { + result = ""; + } + /* View ******************************************************************/ + + void View::paint(Painter &painter) + { + painter.fill_rectangle( + screen_rect(), + style().background); + } + + void View::add_child(Widget *const widget) + { + if (widget) + { + if (widget->parent() == nullptr) + { + widget->set_parent(this); + children_.push_back(widget); + } + } + } + + void View::add_children(const std::initializer_list children) + { + children_.insert(std::end(children_), children); + for (auto child : children) + { + child->set_parent(this); + } + } + + void View::remove_child(Widget *const widget) + { + if (widget) + { + children_.erase(std::remove(children_.begin(), children_.end(), widget), children_.end()); + widget->set_parent(nullptr); + } + } + + void View::remove_children(const std::vector &children) + { + for (auto child : children) + { + remove_child(child); + } + } + + const std::vector &View::children() const + { + return children_; + } + + std::string View::title() const + { + return ""; + }; + + /* OptionTabView *********************************************************/ + + OptionTabView::OptionTabView(Rect parent_rect) + { + set_parent_rect(parent_rect); + + add_child(&check_enable); + hidden(true); + + check_enable.on_select = [this](Checkbox &, bool value) + { + enabled = value; + }; + } + + void OptionTabView::set_enabled(bool value) + { + check_enable.set_value(value); + } + + bool OptionTabView::is_enabled() + { + return check_enable.value(); + } + + void OptionTabView::set_type(std::string type) + { + check_enable.set_text("Transmit " + type); + } + + void OptionTabView::focus() + { + check_enable.focus(); + } + + /* Rectangle *************************************************************/ + + Rectangle::Rectangle( + Color c) + : Widget{}, + color{c} + { + } + + Rectangle::Rectangle( + Rect parent_rect, + Color c) + : Widget{parent_rect}, + color{c} + { + } + + void Rectangle::set_color(const Color c) + { + color = c; + set_dirty(); + } + + void Rectangle::set_outline(const bool outline) + { + _outline = outline; + set_dirty(); + } + + void Rectangle::paint(Painter &painter) + { + if (!_outline) + { + painter.fill_rectangle( + screen_rect(), + color); + } + else + { + painter.draw_rectangle( + screen_rect(), + color); + } + } + + /* Text ******************************************************************/ + + Text::Text( + Rect parent_rect, + std::string text) + : Widget{parent_rect}, + text{std::move(text)} + { + } + + Text::Text( + Rect parent_rect) + : Text{parent_rect, {}} + { + } + + void Text::set(std::string_view value) + { + text = std::string{value}; + set_dirty(); + } + + void Text::getAccessibilityText(std::string &result) + { + result = text; + } + void Text::getWidgetName(std::string &result) + { + result = "Text"; + } + void Text::paint(Painter &painter) + { + const auto rect = screen_rect(); + auto s = has_focus() ? style().invert() : style(); + auto max_len = (unsigned)rect.width() / s.font.char_width(); + auto text_view = std::string_view{text}; + + painter.fill_rectangle(rect, s.background); + + if (text_view.length() > max_len) + text_view = text_view.substr(0, max_len); + + painter.draw_string( + rect.location(), + s, + text_view); + } + + /* Labels ****************************************************************/ + + Labels::Labels( + std::initializer_list