diff --git a/.github/ISSUE_TEMPLATE/Feature-request.yml b/.github/ISSUE_TEMPLATE/Feature-request.yml new file mode 100644 index 00000000000..d50524433da --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Feature-request.yml @@ -0,0 +1,54 @@ +name: Feature request +description: Suggest an idea for this project +labels: ["Type: Feature request"] +body: + - type: markdown + attributes: + value: | + * We welcome any ideas or feature requests! It is helpful if you can explain exactly why the feature would be useful. + * There are usually some outstanding feature requests in the [existing issues list](https://github.com/espressif/arduino-esp32/issues?q=is%3Aopen+is%3Aissue+label%3A%22Type%3A+Feature+request%22), feel free to add comments to them. + * If you would like to contribute, please read the [contributions guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html). + - type: input + id: Area + attributes: + label: Related area + description: Please briefly explain the area of your Feature Request. + placeholder: eg. Board support, specific Peripheral, BT, Wifi... + validations: + required: true + - type: input + id: HW + attributes: + label: Hardware specification + description: Please provide if your proposal depends on specific Hardware. + placeholder: eg. Support for ESP32 DevKitC, ESP32-C3 DevKitM... + validations: + required: true + - type: textarea + id: problem-related + attributes: + label: Is your feature request related to a problem? + description: Please provide a clear and concise description of what the problem is. Add relevant issue link. + placeholder: ex. I'm facing the issue/missing function... + validations: + required: true + - type: textarea + id: solution + attributes: + label: Describe the solution you'd like + description: Please provide a clear and concise description of what you want to happen. + placeholder: ex. When using this function... + validations: + required: true + - type: textarea + id: alternatives + attributes: + label: Describe alternatives you've considered + description: Please provide a clear and concise description of any alternative solutions or features you've considered. + placeholder: ex. Choosing other approach wouldn't work, because... + - type: textarea + id: context + attributes: + label: Additional context + description: Please add any other context or screenshots about the feature request here. + placeholder: ex. This would work only when ... diff --git a/.github/ISSUE_TEMPLATE/Issue-report.yml b/.github/ISSUE_TEMPLATE/Issue-report.yml new file mode 100644 index 00000000000..f355f26628a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Issue-report.yml @@ -0,0 +1,130 @@ +name: Issue report +description: Report any problem here +labels: ["Status: Awaiting triage"] +body: + - type: markdown + attributes: + value: | + * Before reporting a new issue please check and search in [List of existing issues](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue) + * Please check [Online Documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/index.html) + * Take a look on [Troubleshooting guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html) + * If still experiencing the issue, please provide as many details as possible below about your hardware, computer setup and code. + - type: input + id: Board + attributes: + label: Board + description: On which Board does this issue occur? + placeholder: eg. ESP32 Dev Module, ESP32-S2, LilyGo TTGO LoRa32... + validations: + required: true + - type: textarea + id: devboard + attributes: + label: Device Description + description: What development board or other hardware is the chip attached to? + placeholder: ex. DevKitC, plain module on breadboard, etc. If your hardware is custom or unusual, please attach a photo. + validations: + required: true + - type: textarea + id: other-hw + attributes: + label: Hardware Configuration + description: Is anything else attached to the development board? + placeholder: ex. GPIO 18 & 19 are connected to I2C devices. + validations: + required: true + - type: dropdown + id: version + attributes: + label: Version + description: What version of Arduino ESP32 are you running? If possible, consider updating to the latest version. + options: + - latest master + - v2.0.1 + - v2.0.0 + - v1.0.6 + - other + validations: + required: true + - type: input + id: IDE + attributes: + label: IDE Name + description: What IDE are you using? + placeholder: eg. Arduino IDE, PlatformIO, IDF component... + validations: + required: true + - type: input + id: os + attributes: + label: Operating System + description: On which OS does this issue occur? + placeholder: ex. macOS 12.1, Windows 10... + validations: + required: true + - type: input + id: Flash + attributes: + label: Flash frequency + description: What flash frequency is used? + placeholder: eg. 40Mhz + validations: + required: true + - type: dropdown + id: PSRAM + attributes: + label: PSRAM enabled + description: Is PSRAM enabled? + options: + - 'yes' + - 'no' + validations: + required: true + - type: input + id: Upload + attributes: + label: Upload speed + description: What upload speed is used? + placeholder: eg. 115200 + validations: + required: true + - type: textarea + id: Description + attributes: + label: Description + description: Please describe your problem here and expected behaviour + placeholder: ex. Can't connect/weird behaviour/wrong function/missing parameter.. + validations: + required: true + - type: textarea + id: sketch + attributes: + label: Sketch + description: Please provide your sketch/code which was run + placeholder: ex. related part of the code + render: cpp + validations: + required: true + - type: textarea + id: Debug + attributes: + label: Debug Message + description: Please provide a debug message or error message. If you have a Guru Meditation Error or Backtrace, please decode it with [ExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) + placeholder: Enable Core debug level - Debug on tools menu of Arduino IDE, then put the serial output here. + render: plain + validations: + required: true + - type: textarea + id: other-remarks + attributes: + label: Other Steps to Reproduce + description: Is there any other information you can think of which will help us reproduce this problem? Any additional info can be added as well. + placeholder: ex. I also tried on other OS, HW...it works correctly on that setup. + - type: checkboxes + id: confirmation + attributes: + label: I have checked existing issues, online documentation and the Troubleshooting Guide + description: You agree to check all the resources above before opening a new issue. + options: + - label: I confirm I have checked existing issues, online documentation and Troubleshooting guide. + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 63d88b10f38..00000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -name: Bug report -about: Please fill in the bug report carefully -title: '' -labels: '' -assignees: '' - ---- - -Make your question, not a Statement, inclusive. Include all pertinent information: - -What you are trying to do? -Describe your system( Hardware, computer, O/S, core version, environment). -Describe what is failing. -Show the shortest possible code that will duplicate the error. -Show the EXACT error message(it doesn't work is not enough). -All of this work on your part shows us that you have worked to solve YOUR problem. The more complete your issue posting is, the more likely someone will volunteer their time to help you. - -If you have a Guru Meditation Error or Backtrace, ***please decode it***: -https://github.com/me-no-dev/EspExceptionDecoder - ------------------------------ Remove above ----------------------------- - - -### Hardware: -Board: ?ESP32 Dev Module? ?node32? ?ttgo_lora? -Core Installation version: ?1.0.0? ?1.0.1-rc4? ?1.0.1? ?1.0.1-git? ?1.0.2? ?1.0.3? -IDE name: ?Arduino IDE? ?Platform.io? ?IDF component? -Flash Frequency: ?40Mhz? -PSRAM enabled: ?no? ?yes? -Upload Speed: ?115200? -Computer OS: ?Windows 10? ?Mac OSX? ?Ubuntu? - -### Description: -Describe your problem here - - -### Sketch: (leave the backquotes for [code formatting](https://help.github.com/articles/creating-and-highlighting-code-blocks/)) -```cpp - -//Change the code below by your sketch -#include - -void setup() { -} - -void loop() { -} -``` - -### Debug Messages: -``` -Enable Core debug level: Debug on tools menu of Arduino IDE, then put the serial output here -``` diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000000..2a9b0ef82e0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Arduino ESP32 Gitter Channel + url: https://gitter.im/espressif/arduino-esp32 + about: Community channel for questions and help + - name: ESP32 Forum - Arduino + url: https://esp32.com/viewforum.php?f=19 + about: Official Forum for questions \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b1ca40811b7..737f55dcc61 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,16 +1,18 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------- -This entire section can be deleted if all items are checked. - *By completing this PR sufficiently, you help us to improve the quality of Release Notes* ### Checklist - -1. [ ] Please provide specific title of the PR describing the change, including the component name (eg."Update of Documentation link on Readme.md") +1. [ ] Please provide specific title of the PR describing the change, including the component name (eg. *„Update of Documentation link on Readme.md“*) 2. [ ] Please provide related links (eg. Issue, other Project, submodule PR..) ----------------------------------------------------------------------------------------------------------------------------------------------------- +3. [ ] Please check [Contributing guide](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html) +*This entire section above can be deleted if all items are checked.* + +----------- ## Summary Please describe your proposed PR and what it contains. ## Impact Please describe impact of your PR and it's function. + +## Related links +Please provide links to related issue, PRs etc. diff --git a/.github/scripts/check-cmakelists.sh b/.github/scripts/check-cmakelists.sh index 89141ac6e3f..98d9722ad83 100755 --- a/.github/scripts/check-cmakelists.sh +++ b/.github/scripts/check-cmakelists.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# This script is for Travis. It checks all non-examples source files in libraries/ and cores/ are listed in +# This script is used in the CI workflow. It checks all non-examples source files in libraries/ and cores/ are listed in # CMakeLists.txt for the cmake-based IDF component # # If you see an error running this script, edit CMakeLists.txt and add any new source files into your PR diff --git a/.github/scripts/on-pages.sh b/.github/scripts/on-pages.sh old mode 100644 new mode 100755 diff --git a/.github/scripts/on-push.sh b/.github/scripts/on-push.sh index e7d0d0af047..aa30fe746d5 100755 --- a/.github/scripts/on-push.sh +++ b/.github/scripts/on-push.sh @@ -2,18 +2,7 @@ set -e -if [ ! -z "$TRAVIS_TAG" ]; then - echo "Skipping Test: Tagged build" - exit 0 -fi - -if [ ! -z "$GITHUB_WORKSPACE" ]; then - export TRAVIS_BUILD_DIR="$GITHUB_WORKSPACE" - export TRAVIS_REPO_SLUG="$GITHUB_REPOSITORY" -elif [ ! -z "$TRAVIS_BUILD_DIR" ]; then - export GITHUB_WORKSPACE="$TRAVIS_BUILD_DIR" - export GITHUB_REPOSITORY="$TRAVIS_REPO_SLUG" -else +if [ -z "$GITHUB_WORKSPACE" ]; then export GITHUB_WORKSPACE="$PWD" export GITHUB_REPOSITORY="espressif/arduino-esp32" fi diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index eb13f9eed64..6f9cbb2e2ab 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -16,7 +16,7 @@ jobs: name: Build GitHub Pages runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Copy Files env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index e8aec98166c..b73b4d34c67 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -18,8 +18,8 @@ jobs: chunk: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] steps: - - uses: actions/checkout@v1 - - uses: actions/setup-python@v1 + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 with: python-version: '3.x' - name: Build Sketches @@ -34,8 +34,8 @@ jobs: os: [windows-latest, macOS-latest] steps: - - uses: actions/checkout@v1 - - uses: actions/setup-python@v1 + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 with: python-version: '3.x' - name: Build Sketches @@ -50,8 +50,8 @@ jobs: os: [ubuntu-latest, windows-latest, macOS-latest] steps: - - uses: actions/checkout@v1 - - uses: actions/setup-python@v1 + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 with: python-version: '3.x' - name: Build Sketches diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 58891c7165a..da6a8e4ce2f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,10 +10,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - uses: actions/checkout@v2 with: fetch-depth: 0 - - uses: actions/setup-python@v1 + - uses: actions/setup-python@v2 with: python-version: '3.x' - name: Build Release diff --git a/.github/workflows/test_selfhosted_runner.yml b/.github/workflows/test_selfhosted_runner.yml index e7be6a6c4ff..ddac78abbc3 100644 --- a/.github/workflows/test_selfhosted_runner.yml +++ b/.github/workflows/test_selfhosted_runner.yml @@ -10,6 +10,7 @@ jobs: build: name: Dummy test - self hosted GHR runs-on: self-hosted + if: github.repository == 'espressif/arduino-esp32' steps: - name: Check out repo uses: actions/checkout@v2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2fb1dc44dc9..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,55 +0,0 @@ -sudo: false - -language: python - -os: - - linux - -git: - depth: false - -before_install: - - git submodule update --init --recursive - -stages: - - build - - deploy - -jobs: - include: - - - name: "Build Arduino 0" - if: tag IS blank AND (type = pull_request OR (type = push AND branch = master)) - stage: build - script: $TRAVIS_BUILD_DIR/.github/scripts/on-push.sh 0 10 - - - name: "Build Arduino 1" - if: tag IS blank AND (type = pull_request OR (type = push AND branch = master)) - stage: build - script: $TRAVIS_BUILD_DIR/.github/scripts/on-push.sh 1 10 - - - name: "Build Arduino 2" - if: tag IS blank AND (type = pull_request OR (type = push AND branch = master)) - stage: build - script: $TRAVIS_BUILD_DIR/.github/scripts/on-push.sh 2 10 - - - name: "Build Arduino 3" - if: tag IS blank AND (type = pull_request OR (type = push AND branch = master)) - stage: build - script: $TRAVIS_BUILD_DIR/.github/scripts/on-push.sh 3 10 - - - name: "Build PlatformIO" - if: tag IS blank AND (type = pull_request OR (type = push AND branch = master)) - stage: build - script: $TRAVIS_BUILD_DIR/.github/scripts/on-push.sh 1 1 - -notifications: - email: - on_success: change - on_failure: change - webhooks: - urls: - - https://webhooks.gitter.im/e/cb057279c430d91a47a8 - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: never # options: [always|never|change] default: always \ No newline at end of file diff --git a/README.md b/README.md index 757c9c80697..969a8f6fb11 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ You can use [Arduino-ESP32 Online Documentation](https://docs.espressif.com/proj * [FAQ](https://docs.espressif.com/projects/arduino-esp32/en/latest/faq.html) * [Troubleshooting](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html) +### Supported Chips + +Visit the [supported chips](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html#supported-soc-s) documentation to see the list of current supported ESP32 SoCs. + ### Decoding exceptions You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) to get meaningful call trace. @@ -34,7 +38,7 @@ You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecod ### Issue/Bug report template Before reporting an issue, make sure you've searched for similar one that was already created. Also make sure to go through all the issues labelled as [Type: For reference](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue+label%3A%22Type%3A+For+reference%22+). -Finally, if you are sure no one else had the issue, follow the [issue template](docs/ISSUE_TEMPLATE.md) while reporting any issue. +Finally, if you are sure no one else had the issue, follow the **Issue template** or **Feature request template** while reporting any [new Issue](https://github.com/espressif/arduino-esp32/issues/new/choose). ### Contributing diff --git a/boards.txt b/boards.txt index c8c2f6e2a1c..2a74cdf751c 100644 --- a/boards.txt +++ b/boards.txt @@ -1636,63 +1636,76 @@ turta_iot_node.menu.DebugLevel.verbose.build.code_debug=5 ############################################################## -ttgo-lora32-v1.name=TTGO LoRa32-OLED V1 - -ttgo-lora32-v1.upload.tool=esptool_py -ttgo-lora32-v1.upload.maximum_size=1310720 -ttgo-lora32-v1.upload.maximum_data_size=294912 -ttgo-lora32-v1.upload.flags= -ttgo-lora32-v1.upload.extra_flags= - -ttgo-lora32-v1.serial.disableDTR=true -ttgo-lora32-v1.serial.disableRTS=true - -ttgo-lora32-v1.build.tarch=xtensa -ttgo-lora32-v1.build.bootloader_addr=0x1000 -ttgo-lora32-v1.build.target=esp32 -ttgo-lora32-v1.build.mcu=esp32 -ttgo-lora32-v1.build.core=esp32 -ttgo-lora32-v1.build.variant=ttgo-lora32-v1 -ttgo-lora32-v1.build.board=TTGO_LoRa32_V1 - -ttgo-lora32-v1.build.f_cpu=240000000L -ttgo-lora32-v1.build.flash_mode=dio -ttgo-lora32-v1.build.flash_size=4MB -ttgo-lora32-v1.build.boot=dio -ttgo-lora32-v1.build.partitions=default - -ttgo-lora32-v1.menu.FlashFreq.80=80MHz -ttgo-lora32-v1.menu.FlashFreq.80.build.flash_freq=80m -ttgo-lora32-v1.menu.FlashFreq.40=40MHz -ttgo-lora32-v1.menu.FlashFreq.40.build.flash_freq=40m - -ttgo-lora32-v1.menu.UploadSpeed.921600=921600 -ttgo-lora32-v1.menu.UploadSpeed.921600.upload.speed=921600 -ttgo-lora32-v1.menu.UploadSpeed.115200=115200 -ttgo-lora32-v1.menu.UploadSpeed.115200.upload.speed=115200 -ttgo-lora32-v1.menu.UploadSpeed.256000.windows=256000 -ttgo-lora32-v1.menu.UploadSpeed.256000.upload.speed=256000 -ttgo-lora32-v1.menu.UploadSpeed.230400.windows.upload.speed=256000 -ttgo-lora32-v1.menu.UploadSpeed.230400=230400 -ttgo-lora32-v1.menu.UploadSpeed.230400.upload.speed=230400 -ttgo-lora32-v1.menu.UploadSpeed.460800.linux=460800 -ttgo-lora32-v1.menu.UploadSpeed.460800.macosx=460800 -ttgo-lora32-v1.menu.UploadSpeed.460800.upload.speed=460800 -ttgo-lora32-v1.menu.UploadSpeed.512000.windows=512000 -ttgo-lora32-v1.menu.UploadSpeed.512000.upload.speed=512000 - -ttgo-lora32-v1.menu.DebugLevel.none=None -ttgo-lora32-v1.menu.DebugLevel.none.build.code_debug=0 -ttgo-lora32-v1.menu.DebugLevel.error=Error -ttgo-lora32-v1.menu.DebugLevel.error.build.code_debug=1 -ttgo-lora32-v1.menu.DebugLevel.warn=Warn -ttgo-lora32-v1.menu.DebugLevel.warn.build.code_debug=2 -ttgo-lora32-v1.menu.DebugLevel.info=Info -ttgo-lora32-v1.menu.DebugLevel.info.build.code_debug=3 -ttgo-lora32-v1.menu.DebugLevel.debug=Debug -ttgo-lora32-v1.menu.DebugLevel.debug.build.code_debug=4 -ttgo-lora32-v1.menu.DebugLevel.verbose=Verbose -ttgo-lora32-v1.menu.DebugLevel.verbose.build.code_debug=5 + +ttgo-lora32.name=TTGO LoRa32-OLED + +ttgo-lora32.upload.tool=esptool_py +ttgo-lora32.upload.maximum_size=1310720 +ttgo-lora32.upload.maximum_data_size=294912 +ttgo-lora32.upload.flags= +ttgo-lora32.upload.extra_flags= + +ttgo-lora32.serial.disableDTR=true +ttgo-lora32.serial.disableRTS=true + +ttgo-lora32.build.tarch=xtensa +ttgo-lora32.build.bootloader_addr=0x1000 +ttgo-lora32.build.target=esp32 +ttgo-lora32.build.mcu=esp32 +ttgo-lora32.build.core=esp32 +ttgo-lora32.build.board=TTGO_LoRa32 + +ttgo-lora32.menu.Revision.TTGO_LoRa32_V1=TTGO LoRa32 V1 (No TFCard) +ttgo-lora32.menu.Revision.TTGO_LoRa32_V1.build.board=TTGO_LoRa32_V1 +ttgo-lora32.menu.Revision.TTGO_LoRa32_V1.build.variant=ttgo-lora32-v1 + +ttgo-lora32.menu.Revision.TTGO_LoRa32_V2=TTGO LoRa32 V2 +ttgo-lora32.menu.Revision.TTGO_LoRa32_V2.build.board=TTGO_LoRa32_V2 +ttgo-lora32.menu.Revision.TTGO_LoRa32_V2.build.variant=ttgo-lora32-v2 + +ttgo-lora32.menu.Revision.TTGO_LoRa32_v21new=TTGO LoRa32 V2.1 (1.6.1) +ttgo-lora32.menu.Revision.TTGO_LoRa32_v21new.build.board=TTGO_LoRa32_v21new +ttgo-lora32.menu.Revision.TTGO_LoRa32_v21new.build.variant=ttgo-lora32-v21new + +ttgo-lora32.build.f_cpu=240000000L +ttgo-lora32.build.flash_mode=dio +ttgo-lora32.build.flash_size=4MB +ttgo-lora32.build.boot=dio +ttgo-lora32.build.partitions=default + +ttgo-lora32.menu.FlashFreq.80=80MHz +ttgo-lora32.menu.FlashFreq.80.build.flash_freq=80m +ttgo-lora32.menu.FlashFreq.40=40MHz +ttgo-lora32.menu.FlashFreq.40.build.flash_freq=40m + +ttgo-lora32.menu.UploadSpeed.921600=921600 +ttgo-lora32.menu.UploadSpeed.921600.upload.speed=921600 +ttgo-lora32.menu.UploadSpeed.115200=115200 +ttgo-lora32.menu.UploadSpeed.115200.upload.speed=115200 +ttgo-lora32.menu.UploadSpeed.256000.windows=256000 +ttgo-lora32.menu.UploadSpeed.256000.upload.speed=256000 +ttgo-lora32.menu.UploadSpeed.230400.windows.upload.speed=256000 +ttgo-lora32.menu.UploadSpeed.230400=230400 +ttgo-lora32.menu.UploadSpeed.230400.upload.speed=230400 +ttgo-lora32.menu.UploadSpeed.460800.linux=460800 +ttgo-lora32.menu.UploadSpeed.460800.macosx=460800 +ttgo-lora32.menu.UploadSpeed.460800.upload.speed=460800 +ttgo-lora32.menu.UploadSpeed.512000.windows=512000 +ttgo-lora32.menu.UploadSpeed.512000.upload.speed=512000 + +ttgo-lora32.menu.DebugLevel.none=None +ttgo-lora32.menu.DebugLevel.none.build.code_debug=0 +ttgo-lora32.menu.DebugLevel.error=Error +ttgo-lora32.menu.DebugLevel.error.build.code_debug=1 +ttgo-lora32.menu.DebugLevel.warn=Warn +ttgo-lora32.menu.DebugLevel.warn.build.code_debug=2 +ttgo-lora32.menu.DebugLevel.info=Info +ttgo-lora32.menu.DebugLevel.info.build.code_debug=3 +ttgo-lora32.menu.DebugLevel.debug=Debug +ttgo-lora32.menu.DebugLevel.debug.build.code_debug=4 +ttgo-lora32.menu.DebugLevel.verbose=Verbose +ttgo-lora32.menu.DebugLevel.verbose.build.code_debug=5 + ############################################################## @@ -4376,168 +4389,502 @@ adafruit_funhouse_esp32s2.menu.DebugLevel.verbose.build.code_debug=5 ############################################################## -adafruit_feather_esp32s2_nopsram.name=Adafruit Feather ESP32-S2 -adafruit_feather_esp32s2_nopsram.vid.0=0x239A -adafruit_feather_esp32s2_nopsram.pid.0=0x80EB -adafruit_feather_esp32s2_nopsram.vid.1=0x239A -adafruit_feather_esp32s2_nopsram.pid.1=0x00EB -adafruit_feather_esp32s2_nopsram.vid.1=0x239A -adafruit_feather_esp32s2_nopsram.pid.1=0x80EC - -adafruit_feather_esp32s2_nopsram.upload.tool=esptool_py -adafruit_feather_esp32s2_nopsram.upload.maximum_size=1310720 -adafruit_feather_esp32s2_nopsram.upload.maximum_data_size=327680 -adafruit_feather_esp32s2_nopsram.upload.flags= -adafruit_feather_esp32s2_nopsram.upload.extra_flags=0x2d0000 "{runtime.platform.path}/variants/{build.variant}/tinyuf2.bin" -adafruit_feather_esp32s2_nopsram.upload.use_1200bps_touch=true -adafruit_feather_esp32s2_nopsram.upload.wait_for_upload_port=true - -adafruit_feather_esp32s2_nopsram.serial.disableDTR=false -adafruit_feather_esp32s2_nopsram.serial.disableRTS=false - -adafruit_feather_esp32s2_nopsram.build.tarch=xtensa -adafruit_feather_esp32s2_nopsram.build.bootloader_addr=0x1000 -adafruit_feather_esp32s2_nopsram.build.target=esp32s2 -adafruit_feather_esp32s2_nopsram.build.mcu=esp32s2 -adafruit_feather_esp32s2_nopsram.build.core=esp32 -adafruit_feather_esp32s2_nopsram.build.variant=adafruit_feather_esp32s2 -adafruit_feather_esp32s2_nopsram.build.board=ADAFRUIT_FEATHER_ESP32S2 - -adafruit_feather_esp32s2_nopsram.build.cdc_on_boot=0 -adafruit_feather_esp32s2_nopsram.build.msc_on_boot=0 -adafruit_feather_esp32s2_nopsram.build.dfu_on_boot=0 -adafruit_feather_esp32s2_nopsram.build.f_cpu=240000000L -adafruit_feather_esp32s2_nopsram.build.flash_size=4MB -adafruit_feather_esp32s2_nopsram.build.flash_freq=80m -adafruit_feather_esp32s2_nopsram.build.flash_mode=qio -adafruit_feather_esp32s2_nopsram.build.boot=qio -adafruit_feather_esp32s2_nopsram.build.partitions=default -adafruit_feather_esp32s2_nopsram.build.defines= - -adafruit_feather_esp32s2_nopsram.menu.CDCOnBoot.cdc=Enabled -adafruit_feather_esp32s2_nopsram.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 -adafruit_feather_esp32s2_nopsram.menu.CDCOnBoot.default=Disabled -adafruit_feather_esp32s2_nopsram.menu.CDCOnBoot.default.build.cdc_on_boot=0 - -adafruit_feather_esp32s2_nopsram.menu.MSCOnBoot.default=Disabled -adafruit_feather_esp32s2_nopsram.menu.MSCOnBoot.default.build.msc_on_boot=0 -adafruit_feather_esp32s2_nopsram.menu.MSCOnBoot.msc=Enabled -adafruit_feather_esp32s2_nopsram.menu.MSCOnBoot.msc.build.msc_on_boot=1 - -adafruit_feather_esp32s2_nopsram.menu.DFUOnBoot.default=Disabled -adafruit_feather_esp32s2_nopsram.menu.DFUOnBoot.default.build.dfu_on_boot=0 -adafruit_feather_esp32s2_nopsram.menu.DFUOnBoot.dfu=Enabled -adafruit_feather_esp32s2_nopsram.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 - -adafruit_feather_esp32s2_nopsram.menu.PSRAM.enabled=Enabled -adafruit_feather_esp32s2_nopsram.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -adafruit_feather_esp32s2_nopsram.menu.PSRAM.disabled=Disabled -adafruit_feather_esp32s2_nopsram.menu.PSRAM.disabled.build.defines= - -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.default.build.partitions=default -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.defaultffat.build.partitions=default_ffat -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.default_8MB.build.partitions=default_8MB -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.minimal.build.partitions=minimal -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.no_ota.build.partitions=no_ota -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.noota_3g.build.partitions=noota_3g -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.huge_app.build.partitions=huge_app -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.fatflash.build.partitions=ffat -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS) -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB -adafruit_feather_esp32s2_nopsram.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 - -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.240=240MHz (WiFi) -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.240.build.f_cpu=240000000L -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.160=160MHz (WiFi) -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.160.build.f_cpu=160000000L -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.80=80MHz (WiFi) -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.80.build.f_cpu=80000000L -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.40=40MHz -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.40.build.f_cpu=40000000L -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.20=20MHz -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.20.build.f_cpu=20000000L -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.10=10MHz -adafruit_feather_esp32s2_nopsram.menu.CPUFreq.10.build.f_cpu=10000000L - -adafruit_feather_esp32s2_nopsram.menu.FlashMode.qio=QIO -adafruit_feather_esp32s2_nopsram.menu.FlashMode.qio.build.flash_mode=dio -adafruit_feather_esp32s2_nopsram.menu.FlashMode.qio.build.boot=qio -adafruit_feather_esp32s2_nopsram.menu.FlashMode.dio=DIO -adafruit_feather_esp32s2_nopsram.menu.FlashMode.dio.build.flash_mode=dio -adafruit_feather_esp32s2_nopsram.menu.FlashMode.dio.build.boot=dio -adafruit_feather_esp32s2_nopsram.menu.FlashMode.qout=QOUT -adafruit_feather_esp32s2_nopsram.menu.FlashMode.qout.build.flash_mode=dout -adafruit_feather_esp32s2_nopsram.menu.FlashMode.qout.build.boot=qout -adafruit_feather_esp32s2_nopsram.menu.FlashMode.dout=DOUT -adafruit_feather_esp32s2_nopsram.menu.FlashMode.dout.build.flash_mode=dout -adafruit_feather_esp32s2_nopsram.menu.FlashMode.dout.build.boot=dout - -adafruit_feather_esp32s2_nopsram.menu.FlashFreq.80=80MHz -adafruit_feather_esp32s2_nopsram.menu.FlashFreq.80.build.flash_freq=80m -adafruit_feather_esp32s2_nopsram.menu.FlashFreq.40=40MHz -adafruit_feather_esp32s2_nopsram.menu.FlashFreq.40.build.flash_freq=40m - -adafruit_feather_esp32s2_nopsram.menu.FlashSize.4M=4MB (32Mb) -adafruit_feather_esp32s2_nopsram.menu.FlashSize.4M.build.flash_size=4MB -adafruit_feather_esp32s2_nopsram.menu.FlashSize.8M=8MB (64Mb) -adafruit_feather_esp32s2_nopsram.menu.FlashSize.8M.build.flash_size=8MB -adafruit_feather_esp32s2_nopsram.menu.FlashSize.8M.build.partitions=default_8MB -adafruit_feather_esp32s2_nopsram.menu.FlashSize.2M=2MB (16Mb) -adafruit_feather_esp32s2_nopsram.menu.FlashSize.2M.build.flash_size=2MB -adafruit_feather_esp32s2_nopsram.menu.FlashSize.2M.build.partitions=minimal -adafruit_feather_esp32s2_nopsram.menu.FlashSize.16M=16MB (128Mb) -adafruit_feather_esp32s2_nopsram.menu.FlashSize.16M.build.flash_size=16MB - -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.921600=921600 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.921600.upload.speed=921600 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.115200=115200 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.115200.upload.speed=115200 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.256000.windows=256000 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.256000.upload.speed=256000 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.230400.windows.upload.speed=256000 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.230400=230400 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.230400.upload.speed=230400 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.460800.linux=460800 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.460800.macosx=460800 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.460800.upload.speed=460800 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.512000.windows=512000 -adafruit_feather_esp32s2_nopsram.menu.UploadSpeed.512000.upload.speed=512000 - -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.none=None -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.none.build.code_debug=0 -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.error=Error -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.error.build.code_debug=1 -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.warn=Warn -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.warn.build.code_debug=2 -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.info=Info -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.info.build.code_debug=3 -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.debug=Debug -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.debug.build.code_debug=4 -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.verbose=Verbose -adafruit_feather_esp32s2_nopsram.menu.DebugLevel.verbose.build.code_debug=5 +adafruit_feather_esp32s2.name=Adafruit Feather ESP32-S2 +adafruit_feather_esp32s2.vid.0=0x239A +adafruit_feather_esp32s2.pid.0=0x80EB +adafruit_feather_esp32s2.vid.1=0x239A +adafruit_feather_esp32s2.pid.1=0x00EB +adafruit_feather_esp32s2.vid.1=0x239A +adafruit_feather_esp32s2.pid.1=0x80EC + +adafruit_feather_esp32s2.upload.tool=esptool_py +adafruit_feather_esp32s2.upload.maximum_size=1310720 +adafruit_feather_esp32s2.upload.maximum_data_size=327680 +adafruit_feather_esp32s2.upload.flags= +adafruit_feather_esp32s2.upload.extra_flags=0x2d0000 "{runtime.platform.path}/variants/{build.variant}/tinyuf2.bin" +adafruit_feather_esp32s2.upload.use_1200bps_touch=true +adafruit_feather_esp32s2.upload.wait_for_upload_port=true + +adafruit_feather_esp32s2.serial.disableDTR=false +adafruit_feather_esp32s2.serial.disableRTS=false + +adafruit_feather_esp32s2.build.tarch=xtensa +adafruit_feather_esp32s2.build.bootloader_addr=0x1000 +adafruit_feather_esp32s2.build.target=esp32s2 +adafruit_feather_esp32s2.build.mcu=esp32s2 +adafruit_feather_esp32s2.build.core=esp32 +adafruit_feather_esp32s2.build.variant=adafruit_feather_esp32s2 +adafruit_feather_esp32s2.build.board=ADAFRUIT_FEATHER_ESP32S2 + +adafruit_feather_esp32s2.build.cdc_on_boot=1 +adafruit_feather_esp32s2.build.msc_on_boot=0 +adafruit_feather_esp32s2.build.dfu_on_boot=0 +adafruit_feather_esp32s2.build.f_cpu=240000000L +adafruit_feather_esp32s2.build.flash_size=4MB +adafruit_feather_esp32s2.build.flash_freq=80m +adafruit_feather_esp32s2.build.flash_mode=qio +adafruit_feather_esp32s2.build.boot=qio +adafruit_feather_esp32s2.build.partitions=default +adafruit_feather_esp32s2.build.defines= + +adafruit_feather_esp32s2.menu.CDCOnBoot.cdc=Enabled +adafruit_feather_esp32s2.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +adafruit_feather_esp32s2.menu.CDCOnBoot.default=Disabled +adafruit_feather_esp32s2.menu.CDCOnBoot.default.build.cdc_on_boot=0 + +adafruit_feather_esp32s2.menu.MSCOnBoot.default=Disabled +adafruit_feather_esp32s2.menu.MSCOnBoot.default.build.msc_on_boot=0 +adafruit_feather_esp32s2.menu.MSCOnBoot.msc=Enabled +adafruit_feather_esp32s2.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +adafruit_feather_esp32s2.menu.DFUOnBoot.default=Disabled +adafruit_feather_esp32s2.menu.DFUOnBoot.default.build.dfu_on_boot=0 +adafruit_feather_esp32s2.menu.DFUOnBoot.dfu=Enabled +adafruit_feather_esp32s2.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +adafruit_feather_esp32s2.menu.UploadMode.cdc=Internal USB +adafruit_feather_esp32s2.menu.UploadMode.cdc.upload.use_1200bps_touch=true +adafruit_feather_esp32s2.menu.UploadMode.cdc.upload.wait_for_upload_port=true +adafruit_feather_esp32s2.menu.UploadMode.default=UART0 +adafruit_feather_esp32s2.menu.UploadMode.default.upload.use_1200bps_touch=false +adafruit_feather_esp32s2.menu.UploadMode.default.upload.wait_for_upload_port=false + +adafruit_feather_esp32s2.menu.PSRAM.enabled=Enabled +adafruit_feather_esp32s2.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM +adafruit_feather_esp32s2.menu.PSRAM.disabled=Disabled +adafruit_feather_esp32s2.menu.PSRAM.disabled.build.defines= + +adafruit_feather_esp32s2.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +adafruit_feather_esp32s2.menu.PartitionScheme.default.build.partitions=default +adafruit_feather_esp32s2.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +adafruit_feather_esp32s2.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +adafruit_feather_esp32s2.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT) +adafruit_feather_esp32s2.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +adafruit_feather_esp32s2.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +adafruit_feather_esp32s2.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +adafruit_feather_esp32s2.menu.PartitionScheme.minimal.build.partitions=minimal +adafruit_feather_esp32s2.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +adafruit_feather_esp32s2.menu.PartitionScheme.no_ota.build.partitions=no_ota +adafruit_feather_esp32s2.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +adafruit_feather_esp32s2.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +adafruit_feather_esp32s2.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +adafruit_feather_esp32s2.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +adafruit_feather_esp32s2.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +adafruit_feather_esp32s2.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +adafruit_feather_esp32s2.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +adafruit_feather_esp32s2.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +adafruit_feather_esp32s2.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +adafruit_feather_esp32s2.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +adafruit_feather_esp32s2.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +adafruit_feather_esp32s2.menu.PartitionScheme.huge_app.build.partitions=huge_app +adafruit_feather_esp32s2.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +adafruit_feather_esp32s2.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +adafruit_feather_esp32s2.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +adafruit_feather_esp32s2.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +adafruit_feather_esp32s2.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT) +adafruit_feather_esp32s2.menu.PartitionScheme.fatflash.build.partitions=ffat +adafruit_feather_esp32s2.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +adafruit_feather_esp32s2.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS) +adafruit_feather_esp32s2.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +adafruit_feather_esp32s2.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 + +adafruit_feather_esp32s2.menu.CPUFreq.240=240MHz (WiFi) +adafruit_feather_esp32s2.menu.CPUFreq.240.build.f_cpu=240000000L +adafruit_feather_esp32s2.menu.CPUFreq.160=160MHz (WiFi) +adafruit_feather_esp32s2.menu.CPUFreq.160.build.f_cpu=160000000L +adafruit_feather_esp32s2.menu.CPUFreq.80=80MHz (WiFi) +adafruit_feather_esp32s2.menu.CPUFreq.80.build.f_cpu=80000000L +adafruit_feather_esp32s2.menu.CPUFreq.40=40MHz +adafruit_feather_esp32s2.menu.CPUFreq.40.build.f_cpu=40000000L +adafruit_feather_esp32s2.menu.CPUFreq.20=20MHz +adafruit_feather_esp32s2.menu.CPUFreq.20.build.f_cpu=20000000L +adafruit_feather_esp32s2.menu.CPUFreq.10=10MHz +adafruit_feather_esp32s2.menu.CPUFreq.10.build.f_cpu=10000000L + +adafruit_feather_esp32s2.menu.FlashMode.qio=QIO +adafruit_feather_esp32s2.menu.FlashMode.qio.build.flash_mode=dio +adafruit_feather_esp32s2.menu.FlashMode.qio.build.boot=qio +adafruit_feather_esp32s2.menu.FlashMode.dio=DIO +adafruit_feather_esp32s2.menu.FlashMode.dio.build.flash_mode=dio +adafruit_feather_esp32s2.menu.FlashMode.dio.build.boot=dio +adafruit_feather_esp32s2.menu.FlashMode.qout=QOUT +adafruit_feather_esp32s2.menu.FlashMode.qout.build.flash_mode=dout +adafruit_feather_esp32s2.menu.FlashMode.qout.build.boot=qout +adafruit_feather_esp32s2.menu.FlashMode.dout=DOUT +adafruit_feather_esp32s2.menu.FlashMode.dout.build.flash_mode=dout +adafruit_feather_esp32s2.menu.FlashMode.dout.build.boot=dout + +adafruit_feather_esp32s2.menu.FlashFreq.80=80MHz +adafruit_feather_esp32s2.menu.FlashFreq.80.build.flash_freq=80m +adafruit_feather_esp32s2.menu.FlashFreq.40=40MHz +adafruit_feather_esp32s2.menu.FlashFreq.40.build.flash_freq=40m + +adafruit_feather_esp32s2.menu.FlashSize.4M=4MB (32Mb) +adafruit_feather_esp32s2.menu.FlashSize.4M.build.flash_size=4MB +adafruit_feather_esp32s2.menu.FlashSize.8M=8MB (64Mb) +adafruit_feather_esp32s2.menu.FlashSize.8M.build.flash_size=8MB +adafruit_feather_esp32s2.menu.FlashSize.8M.build.partitions=default_8MB +adafruit_feather_esp32s2.menu.FlashSize.2M=2MB (16Mb) +adafruit_feather_esp32s2.menu.FlashSize.2M.build.flash_size=2MB +adafruit_feather_esp32s2.menu.FlashSize.2M.build.partitions=minimal +adafruit_feather_esp32s2.menu.FlashSize.16M=16MB (128Mb) +adafruit_feather_esp32s2.menu.FlashSize.16M.build.flash_size=16MB + +adafruit_feather_esp32s2.menu.UploadSpeed.921600=921600 +adafruit_feather_esp32s2.menu.UploadSpeed.921600.upload.speed=921600 +adafruit_feather_esp32s2.menu.UploadSpeed.115200=115200 +adafruit_feather_esp32s2.menu.UploadSpeed.115200.upload.speed=115200 +adafruit_feather_esp32s2.menu.UploadSpeed.256000.windows=256000 +adafruit_feather_esp32s2.menu.UploadSpeed.256000.upload.speed=256000 +adafruit_feather_esp32s2.menu.UploadSpeed.230400.windows.upload.speed=256000 +adafruit_feather_esp32s2.menu.UploadSpeed.230400=230400 +adafruit_feather_esp32s2.menu.UploadSpeed.230400.upload.speed=230400 +adafruit_feather_esp32s2.menu.UploadSpeed.460800.linux=460800 +adafruit_feather_esp32s2.menu.UploadSpeed.460800.macosx=460800 +adafruit_feather_esp32s2.menu.UploadSpeed.460800.upload.speed=460800 +adafruit_feather_esp32s2.menu.UploadSpeed.512000.windows=512000 +adafruit_feather_esp32s2.menu.UploadSpeed.512000.upload.speed=512000 + +adafruit_feather_esp32s2.menu.DebugLevel.none=None +adafruit_feather_esp32s2.menu.DebugLevel.none.build.code_debug=0 +adafruit_feather_esp32s2.menu.DebugLevel.error=Error +adafruit_feather_esp32s2.menu.DebugLevel.error.build.code_debug=1 +adafruit_feather_esp32s2.menu.DebugLevel.warn=Warn +adafruit_feather_esp32s2.menu.DebugLevel.warn.build.code_debug=2 +adafruit_feather_esp32s2.menu.DebugLevel.info=Info +adafruit_feather_esp32s2.menu.DebugLevel.info.build.code_debug=3 +adafruit_feather_esp32s2.menu.DebugLevel.debug=Debug +adafruit_feather_esp32s2.menu.DebugLevel.debug.build.code_debug=4 +adafruit_feather_esp32s2.menu.DebugLevel.verbose=Verbose +adafruit_feather_esp32s2.menu.DebugLevel.verbose.build.code_debug=5 + +############################################################## +adafruit_feather_esp32s2_tft.name=Adafruit Feather ESP32-S2 TFT +adafruit_feather_esp32s2_tft.vid.0=0x239A +adafruit_feather_esp32s2_tft.pid.0=0x810F +adafruit_feather_esp32s2_tft.vid.1=0x239A +adafruit_feather_esp32s2_tft.pid.1=0x010F +adafruit_feather_esp32s2_tft.vid.1=0x239A +adafruit_feather_esp32s2_tft.pid.1=0x8110 + +adafruit_feather_esp32s2_tft.upload.tool=esptool_py +adafruit_feather_esp32s2_tft.upload.maximum_size=1310720 +adafruit_feather_esp32s2_tft.upload.maximum_data_size=327680 +adafruit_feather_esp32s2_tft.upload.flags= +adafruit_feather_esp32s2_tft.upload.extra_flags=0x2d0000 "{runtime.platform.path}/variants/{build.variant}/tinyuf2.bin" +adafruit_feather_esp32s2_tft.upload.use_1200bps_touch=true +adafruit_feather_esp32s2_tft.upload.wait_for_upload_port=true + +adafruit_feather_esp32s2_tft.serial.disableDTR=false +adafruit_feather_esp32s2_tft.serial.disableRTS=false + +adafruit_feather_esp32s2_tft.build.tarch=xtensa +adafruit_feather_esp32s2_tft.build.bootloader_addr=0x1000 +adafruit_feather_esp32s2_tft.build.target=esp32s2 +adafruit_feather_esp32s2_tft.build.mcu=esp32s2 +adafruit_feather_esp32s2_tft.build.core=esp32 +adafruit_feather_esp32s2_tft.build.variant=adafruit_feather_esp32s2_tft +adafruit_feather_esp32s2_tft.build.board=ADAFRUIT_FEATHER_ESP32S2_TFT + +adafruit_feather_esp32s2_tft.build.cdc_on_boot=0 +adafruit_feather_esp32s2_tft.build.msc_on_boot=0 +adafruit_feather_esp32s2_tft.build.dfu_on_boot=0 +adafruit_feather_esp32s2_tft.build.f_cpu=240000000L +adafruit_feather_esp32s2_tft.build.flash_size=4MB +adafruit_feather_esp32s2_tft.build.flash_freq=80m +adafruit_feather_esp32s2_tft.build.flash_mode=qio +adafruit_feather_esp32s2_tft.build.boot=qio +adafruit_feather_esp32s2_tft.build.partitions=default +adafruit_feather_esp32s2_tft.build.defines= + +adafruit_feather_esp32s2_tft.menu.CDCOnBoot.cdc=Enabled +adafruit_feather_esp32s2_tft.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +adafruit_feather_esp32s2_tft.menu.CDCOnBoot.default=Disabled +adafruit_feather_esp32s2_tft.menu.CDCOnBoot.default.build.cdc_on_boot=0 + +adafruit_feather_esp32s2_tft.menu.MSCOnBoot.default=Disabled +adafruit_feather_esp32s2_tft.menu.MSCOnBoot.default.build.msc_on_boot=0 +adafruit_feather_esp32s2_tft.menu.MSCOnBoot.msc=Enabled +adafruit_feather_esp32s2_tft.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +adafruit_feather_esp32s2_tft.menu.DFUOnBoot.default=Disabled +adafruit_feather_esp32s2_tft.menu.DFUOnBoot.default.build.dfu_on_boot=0 +adafruit_feather_esp32s2_tft.menu.DFUOnBoot.dfu=Enabled +adafruit_feather_esp32s2_tft.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +adafruit_feather_esp32s2_tft.menu.PSRAM.enabled=Enabled +adafruit_feather_esp32s2_tft.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM +adafruit_feather_esp32s2_tft.menu.PSRAM.disabled=Disabled +adafruit_feather_esp32s2_tft.menu.PSRAM.disabled.build.defines= + +adafruit_feather_esp32s2_tft.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.default.build.partitions=default +adafruit_feather_esp32s2_tft.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +adafruit_feather_esp32s2_tft.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +adafruit_feather_esp32s2_tft.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +adafruit_feather_esp32s2_tft.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.minimal.build.partitions=minimal +adafruit_feather_esp32s2_tft.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.no_ota.build.partitions=no_ota +adafruit_feather_esp32s2_tft.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +adafruit_feather_esp32s2_tft.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +adafruit_feather_esp32s2_tft.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +adafruit_feather_esp32s2_tft.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +adafruit_feather_esp32s2_tft.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +adafruit_feather_esp32s2_tft.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +adafruit_feather_esp32s2_tft.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +adafruit_feather_esp32s2_tft.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.huge_app.build.partitions=huge_app +adafruit_feather_esp32s2_tft.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +adafruit_feather_esp32s2_tft.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +adafruit_feather_esp32s2_tft.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +adafruit_feather_esp32s2_tft.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.fatflash.build.partitions=ffat +adafruit_feather_esp32s2_tft.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +adafruit_feather_esp32s2_tft.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS) +adafruit_feather_esp32s2_tft.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +adafruit_feather_esp32s2_tft.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 + +adafruit_feather_esp32s2_tft.menu.CPUFreq.240=240MHz (WiFi) +adafruit_feather_esp32s2_tft.menu.CPUFreq.240.build.f_cpu=240000000L +adafruit_feather_esp32s2_tft.menu.CPUFreq.160=160MHz (WiFi) +adafruit_feather_esp32s2_tft.menu.CPUFreq.160.build.f_cpu=160000000L +adafruit_feather_esp32s2_tft.menu.CPUFreq.80=80MHz (WiFi) +adafruit_feather_esp32s2_tft.menu.CPUFreq.80.build.f_cpu=80000000L +adafruit_feather_esp32s2_tft.menu.CPUFreq.40=40MHz +adafruit_feather_esp32s2_tft.menu.CPUFreq.40.build.f_cpu=40000000L +adafruit_feather_esp32s2_tft.menu.CPUFreq.20=20MHz +adafruit_feather_esp32s2_tft.menu.CPUFreq.20.build.f_cpu=20000000L +adafruit_feather_esp32s2_tft.menu.CPUFreq.10=10MHz +adafruit_feather_esp32s2_tft.menu.CPUFreq.10.build.f_cpu=10000000L + +adafruit_feather_esp32s2_tft.menu.FlashMode.qio=QIO +adafruit_feather_esp32s2_tft.menu.FlashMode.qio.build.flash_mode=dio +adafruit_feather_esp32s2_tft.menu.FlashMode.qio.build.boot=qio +adafruit_feather_esp32s2_tft.menu.FlashMode.dio=DIO +adafruit_feather_esp32s2_tft.menu.FlashMode.dio.build.flash_mode=dio +adafruit_feather_esp32s2_tft.menu.FlashMode.dio.build.boot=dio +adafruit_feather_esp32s2_tft.menu.FlashMode.qout=QOUT +adafruit_feather_esp32s2_tft.menu.FlashMode.qout.build.flash_mode=dout +adafruit_feather_esp32s2_tft.menu.FlashMode.qout.build.boot=qout +adafruit_feather_esp32s2_tft.menu.FlashMode.dout=DOUT +adafruit_feather_esp32s2_tft.menu.FlashMode.dout.build.flash_mode=dout +adafruit_feather_esp32s2_tft.menu.FlashMode.dout.build.boot=dout + +adafruit_feather_esp32s2_tft.menu.FlashFreq.80=80MHz +adafruit_feather_esp32s2_tft.menu.FlashFreq.80.build.flash_freq=80m +adafruit_feather_esp32s2_tft.menu.FlashFreq.40=40MHz +adafruit_feather_esp32s2_tft.menu.FlashFreq.40.build.flash_freq=40m + +adafruit_feather_esp32s2_tft.menu.FlashSize.4M=4MB (32Mb) +adafruit_feather_esp32s2_tft.menu.FlashSize.4M.build.flash_size=4MB +adafruit_feather_esp32s2_tft.menu.FlashSize.8M=8MB (64Mb) +adafruit_feather_esp32s2_tft.menu.FlashSize.8M.build.flash_size=8MB +adafruit_feather_esp32s2_tft.menu.FlashSize.8M.build.partitions=default_8MB +adafruit_feather_esp32s2_tft.menu.FlashSize.2M=2MB (16Mb) +adafruit_feather_esp32s2_tft.menu.FlashSize.2M.build.flash_size=2MB +adafruit_feather_esp32s2_tft.menu.FlashSize.2M.build.partitions=minimal +adafruit_feather_esp32s2_tft.menu.FlashSize.16M=16MB (128Mb) +adafruit_feather_esp32s2_tft.menu.FlashSize.16M.build.flash_size=16MB + +adafruit_feather_esp32s2_tft.menu.UploadSpeed.921600=921600 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.921600.upload.speed=921600 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.115200=115200 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.115200.upload.speed=115200 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.256000.windows=256000 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.256000.upload.speed=256000 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.230400.windows.upload.speed=256000 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.230400=230400 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.230400.upload.speed=230400 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.460800.linux=460800 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.460800.macosx=460800 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.460800.upload.speed=460800 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.512000.windows=512000 +adafruit_feather_esp32s2_tft.menu.UploadSpeed.512000.upload.speed=512000 + +adafruit_feather_esp32s2_tft.menu.DebugLevel.none=None +adafruit_feather_esp32s2_tft.menu.DebugLevel.none.build.code_debug=0 +adafruit_feather_esp32s2_tft.menu.DebugLevel.error=Error +adafruit_feather_esp32s2_tft.menu.DebugLevel.error.build.code_debug=1 +adafruit_feather_esp32s2_tft.menu.DebugLevel.warn=Warn +adafruit_feather_esp32s2_tft.menu.DebugLevel.warn.build.code_debug=2 +adafruit_feather_esp32s2_tft.menu.DebugLevel.info=Info +adafruit_feather_esp32s2_tft.menu.DebugLevel.info.build.code_debug=3 +adafruit_feather_esp32s2_tft.menu.DebugLevel.debug=Debug +adafruit_feather_esp32s2_tft.menu.DebugLevel.debug.build.code_debug=4 +adafruit_feather_esp32s2_tft.menu.DebugLevel.verbose=Verbose +adafruit_feather_esp32s2_tft.menu.DebugLevel.verbose.build.code_debug=5 + +############################################################## + +adafruit_qtpy_esp32s2.name=Adafruit QT Py ESP32-S2 +adafruit_qtpy_esp32s2.vid.0=0x239A +adafruit_qtpy_esp32s2.pid.0=0x8111 +adafruit_qtpy_esp32s2.vid.1=0x239A +adafruit_qtpy_esp32s2.pid.1=0x0111 +adafruit_qtpy_esp32s2.vid.1=0x239A +adafruit_qtpy_esp32s2.pid.1=0x8112 + +adafruit_qtpy_esp32s2.upload.tool=esptool_py +adafruit_qtpy_esp32s2.upload.maximum_size=1310720 +adafruit_qtpy_esp32s2.upload.maximum_data_size=327680 +adafruit_qtpy_esp32s2.upload.flags= +adafruit_qtpy_esp32s2.upload.extra_flags=0x2d0000 "{runtime.platform.path}/variants/{build.variant}/tinyuf2.bin" +adafruit_qtpy_esp32s2.upload.use_1200bps_touch=true +adafruit_qtpy_esp32s2.upload.wait_for_upload_port=true + +adafruit_qtpy_esp32s2.serial.disableDTR=false +adafruit_qtpy_esp32s2.serial.disableRTS=false + +adafruit_qtpy_esp32s2.build.tarch=xtensa +adafruit_qtpy_esp32s2.build.bootloader_addr=0x1000 +adafruit_qtpy_esp32s2.build.target=esp32s2 +adafruit_qtpy_esp32s2.build.mcu=esp32s2 +adafruit_qtpy_esp32s2.build.core=esp32 +adafruit_qtpy_esp32s2.build.variant=adafruit_qtpy_esp32s2 +adafruit_qtpy_esp32s2.build.board=ADAFRUIT_QTPY_ESP32S2 + +adafruit_qtpy_esp32s2.build.cdc_on_boot=0 +adafruit_qtpy_esp32s2.build.msc_on_boot=0 +adafruit_qtpy_esp32s2.build.dfu_on_boot=0 +adafruit_qtpy_esp32s2.build.f_cpu=240000000L +adafruit_qtpy_esp32s2.build.flash_size=4MB +adafruit_qtpy_esp32s2.build.flash_freq=80m +adafruit_qtpy_esp32s2.build.flash_mode=qio +adafruit_qtpy_esp32s2.build.boot=qio +adafruit_qtpy_esp32s2.build.partitions=default +adafruit_qtpy_esp32s2.build.defines= + +adafruit_qtpy_esp32s2.menu.CDCOnBoot.cdc=Enabled +adafruit_qtpy_esp32s2.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +adafruit_qtpy_esp32s2.menu.CDCOnBoot.default=Disabled +adafruit_qtpy_esp32s2.menu.CDCOnBoot.default.build.cdc_on_boot=0 + +adafruit_qtpy_esp32s2.menu.MSCOnBoot.default=Disabled +adafruit_qtpy_esp32s2.menu.MSCOnBoot.default.build.msc_on_boot=0 +adafruit_qtpy_esp32s2.menu.MSCOnBoot.msc=Enabled +adafruit_qtpy_esp32s2.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +adafruit_qtpy_esp32s2.menu.DFUOnBoot.default=Disabled +adafruit_qtpy_esp32s2.menu.DFUOnBoot.default.build.dfu_on_boot=0 +adafruit_qtpy_esp32s2.menu.DFUOnBoot.dfu=Enabled +adafruit_qtpy_esp32s2.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 + +adafruit_qtpy_esp32s2.menu.PSRAM.enabled=Enabled +adafruit_qtpy_esp32s2.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM +adafruit_qtpy_esp32s2.menu.PSRAM.disabled=Disabled +adafruit_qtpy_esp32s2.menu.PSRAM.disabled.build.defines= + +adafruit_qtpy_esp32s2.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +adafruit_qtpy_esp32s2.menu.PartitionScheme.default.build.partitions=default +adafruit_qtpy_esp32s2.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +adafruit_qtpy_esp32s2.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +adafruit_qtpy_esp32s2.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT) +adafruit_qtpy_esp32s2.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +adafruit_qtpy_esp32s2.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +adafruit_qtpy_esp32s2.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +adafruit_qtpy_esp32s2.menu.PartitionScheme.minimal.build.partitions=minimal +adafruit_qtpy_esp32s2.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +adafruit_qtpy_esp32s2.menu.PartitionScheme.no_ota.build.partitions=no_ota +adafruit_qtpy_esp32s2.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +adafruit_qtpy_esp32s2.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +adafruit_qtpy_esp32s2.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +adafruit_qtpy_esp32s2.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +adafruit_qtpy_esp32s2.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +adafruit_qtpy_esp32s2.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +adafruit_qtpy_esp32s2.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +adafruit_qtpy_esp32s2.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +adafruit_qtpy_esp32s2.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +adafruit_qtpy_esp32s2.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +adafruit_qtpy_esp32s2.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +adafruit_qtpy_esp32s2.menu.PartitionScheme.huge_app.build.partitions=huge_app +adafruit_qtpy_esp32s2.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +adafruit_qtpy_esp32s2.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +adafruit_qtpy_esp32s2.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +adafruit_qtpy_esp32s2.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +adafruit_qtpy_esp32s2.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT) +adafruit_qtpy_esp32s2.menu.PartitionScheme.fatflash.build.partitions=ffat +adafruit_qtpy_esp32s2.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 +adafruit_qtpy_esp32s2.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS) +adafruit_qtpy_esp32s2.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB +adafruit_qtpy_esp32s2.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 + +adafruit_qtpy_esp32s2.menu.CPUFreq.240=240MHz (WiFi) +adafruit_qtpy_esp32s2.menu.CPUFreq.240.build.f_cpu=240000000L +adafruit_qtpy_esp32s2.menu.CPUFreq.160=160MHz (WiFi) +adafruit_qtpy_esp32s2.menu.CPUFreq.160.build.f_cpu=160000000L +adafruit_qtpy_esp32s2.menu.CPUFreq.80=80MHz (WiFi) +adafruit_qtpy_esp32s2.menu.CPUFreq.80.build.f_cpu=80000000L +adafruit_qtpy_esp32s2.menu.CPUFreq.40=40MHz +adafruit_qtpy_esp32s2.menu.CPUFreq.40.build.f_cpu=40000000L +adafruit_qtpy_esp32s2.menu.CPUFreq.20=20MHz +adafruit_qtpy_esp32s2.menu.CPUFreq.20.build.f_cpu=20000000L +adafruit_qtpy_esp32s2.menu.CPUFreq.10=10MHz +adafruit_qtpy_esp32s2.menu.CPUFreq.10.build.f_cpu=10000000L + +adafruit_qtpy_esp32s2.menu.FlashMode.qio=QIO +adafruit_qtpy_esp32s2.menu.FlashMode.qio.build.flash_mode=dio +adafruit_qtpy_esp32s2.menu.FlashMode.qio.build.boot=qio +adafruit_qtpy_esp32s2.menu.FlashMode.dio=DIO +adafruit_qtpy_esp32s2.menu.FlashMode.dio.build.flash_mode=dio +adafruit_qtpy_esp32s2.menu.FlashMode.dio.build.boot=dio +adafruit_qtpy_esp32s2.menu.FlashMode.qout=QOUT +adafruit_qtpy_esp32s2.menu.FlashMode.qout.build.flash_mode=dout +adafruit_qtpy_esp32s2.menu.FlashMode.qout.build.boot=qout +adafruit_qtpy_esp32s2.menu.FlashMode.dout=DOUT +adafruit_qtpy_esp32s2.menu.FlashMode.dout.build.flash_mode=dout +adafruit_qtpy_esp32s2.menu.FlashMode.dout.build.boot=dout + +adafruit_qtpy_esp32s2.menu.FlashFreq.80=80MHz +adafruit_qtpy_esp32s2.menu.FlashFreq.80.build.flash_freq=80m +adafruit_qtpy_esp32s2.menu.FlashFreq.40=40MHz +adafruit_qtpy_esp32s2.menu.FlashFreq.40.build.flash_freq=40m + +adafruit_qtpy_esp32s2.menu.FlashSize.4M=4MB (32Mb) +adafruit_qtpy_esp32s2.menu.FlashSize.4M.build.flash_size=4MB +adafruit_qtpy_esp32s2.menu.FlashSize.8M=8MB (64Mb) +adafruit_qtpy_esp32s2.menu.FlashSize.8M.build.flash_size=8MB +adafruit_qtpy_esp32s2.menu.FlashSize.8M.build.partitions=default_8MB +adafruit_qtpy_esp32s2.menu.FlashSize.2M=2MB (16Mb) +adafruit_qtpy_esp32s2.menu.FlashSize.2M.build.flash_size=2MB +adafruit_qtpy_esp32s2.menu.FlashSize.2M.build.partitions=minimal +adafruit_qtpy_esp32s2.menu.FlashSize.16M=16MB (128Mb) +adafruit_qtpy_esp32s2.menu.FlashSize.16M.build.flash_size=16MB + +adafruit_qtpy_esp32s2.menu.UploadSpeed.921600=921600 +adafruit_qtpy_esp32s2.menu.UploadSpeed.921600.upload.speed=921600 +adafruit_qtpy_esp32s2.menu.UploadSpeed.115200=115200 +adafruit_qtpy_esp32s2.menu.UploadSpeed.115200.upload.speed=115200 +adafruit_qtpy_esp32s2.menu.UploadSpeed.256000.windows=256000 +adafruit_qtpy_esp32s2.menu.UploadSpeed.256000.upload.speed=256000 +adafruit_qtpy_esp32s2.menu.UploadSpeed.230400.windows.upload.speed=256000 +adafruit_qtpy_esp32s2.menu.UploadSpeed.230400=230400 +adafruit_qtpy_esp32s2.menu.UploadSpeed.230400.upload.speed=230400 +adafruit_qtpy_esp32s2.menu.UploadSpeed.460800.linux=460800 +adafruit_qtpy_esp32s2.menu.UploadSpeed.460800.macosx=460800 +adafruit_qtpy_esp32s2.menu.UploadSpeed.460800.upload.speed=460800 +adafruit_qtpy_esp32s2.menu.UploadSpeed.512000.windows=512000 +adafruit_qtpy_esp32s2.menu.UploadSpeed.512000.upload.speed=512000 + +adafruit_qtpy_esp32s2.menu.DebugLevel.none=None +adafruit_qtpy_esp32s2.menu.DebugLevel.none.build.code_debug=0 +adafruit_qtpy_esp32s2.menu.DebugLevel.error=Error +adafruit_qtpy_esp32s2.menu.DebugLevel.error.build.code_debug=1 +adafruit_qtpy_esp32s2.menu.DebugLevel.warn=Warn +adafruit_qtpy_esp32s2.menu.DebugLevel.warn.build.code_debug=2 +adafruit_qtpy_esp32s2.menu.DebugLevel.info=Info +adafruit_qtpy_esp32s2.menu.DebugLevel.info.build.code_debug=3 +adafruit_qtpy_esp32s2.menu.DebugLevel.debug=Debug +adafruit_qtpy_esp32s2.menu.DebugLevel.debug.build.code_debug=4 +adafruit_qtpy_esp32s2.menu.DebugLevel.verbose=Verbose +adafruit_qtpy_esp32s2.menu.DebugLevel.verbose.build.code_debug=5 ############################################################## @@ -6692,6 +7039,101 @@ wipy3.menu.DebugLevel.verbose.build.code_debug=5 ############################################################## +wt32-eth01.name=WT32-ETH01 Ethernet Module + +wt32-eth01.upload.tool=esptool_py +wt32-eth01.upload.maximum_size=8388608 +wt32-eth01.upload.maximum_data_size=327680 +wt32-eth01.upload.flags= +wt32-eth01.upload.extra_flags= + +wt32-eth01.serial.disableDTR=true +wt32-eth01.serial.disableRTS=true + +wt32-eth01.build.tarch=xtensa +wt32-eth01.build.bootloader_addr=0x1000 +wt32-eth01.build.target=esp32 +wt32-eth01.build.mcu=esp32 +wt32-eth01.build.core=esp32 +wt32-eth01.build.variant=wt32-eth0 +wt32-eth01.build.board=WT32_ETH01 + +wt32-eth01.build.f_cpu=240000000L +wt32-eth01.build.flash_size=4MB +wt32-eth01.build.flash_freq=40m +wt32-eth01.build.flash_mode=dio +wt32-eth01.build.boot=dio +wt32-eth01.build.partitions=default +wt32-eth01.build.defines= +wt32-eth01.build.extra_libs= + +wt32-eth01.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +wt32-eth01.menu.PartitionScheme.default.build.partitions=default +wt32-eth01.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +wt32-eth01.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +wt32-eth01.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +wt32-eth01.menu.PartitionScheme.minimal.build.partitions=minimal +wt32-eth01.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +wt32-eth01.menu.PartitionScheme.no_ota.build.partitions=no_ota +wt32-eth01.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +wt32-eth01.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +wt32-eth01.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +wt32-eth01.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +wt32-eth01.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +wt32-eth01.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +wt32-eth01.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +wt32-eth01.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +wt32-eth01.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +wt32-eth01.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +wt32-eth01.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +wt32-eth01.menu.PartitionScheme.huge_app.build.partitions=huge_app +wt32-eth01.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +wt32-eth01.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +wt32-eth01.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +wt32-eth01.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 + +wt32-eth01.menu.FlashMode.qio=QIO +wt32-eth01.menu.FlashMode.qio.build.flash_mode=dio +wt32-eth01.menu.FlashMode.qio.build.boot=qio +wt32-eth01.menu.FlashMode.dio=DIO +wt32-eth01.menu.FlashMode.dio.build.flash_mode=dio +wt32-eth01.menu.FlashMode.dio.build.boot=dio + +wt32-eth01.menu.FlashFreq.80=80MHz +wt32-eth01.menu.FlashFreq.80.build.flash_freq=80m +wt32-eth01.menu.FlashFreq.40=40MHz +wt32-eth01.menu.FlashFreq.40.build.flash_freq=40m + +wt32-eth01.menu.UploadSpeed.921600=921600 +wt32-eth01.menu.UploadSpeed.921600.upload.speed=921600 +wt32-eth01.menu.UploadSpeed.115200=115200 +wt32-eth01.menu.UploadSpeed.115200.upload.speed=115200 +wt32-eth01.menu.UploadSpeed.256000.windows=256000 +wt32-eth01.menu.UploadSpeed.256000.upload.speed=256000 +wt32-eth01.menu.UploadSpeed.230400.windows.upload.speed=256000 +wt32-eth01.menu.UploadSpeed.230400=230400 +wt32-eth01.menu.UploadSpeed.230400.upload.speed=230400 +wt32-eth01.menu.UploadSpeed.460800.linux=460800 +wt32-eth01.menu.UploadSpeed.460800.macosx=460800 +wt32-eth01.menu.UploadSpeed.460800.upload.speed=460800 +wt32-eth01.menu.UploadSpeed.512000.windows=512000 +wt32-eth01.menu.UploadSpeed.512000.upload.speed=512000 + +wt32-eth01.menu.DebugLevel.none=None +wt32-eth01.menu.DebugLevel.none.build.code_debug=0 +wt32-eth01.menu.DebugLevel.error=Error +wt32-eth01.menu.DebugLevel.error.build.code_debug=1 +wt32-eth01.menu.DebugLevel.warn=Warn +wt32-eth01.menu.DebugLevel.warn.build.code_debug=2 +wt32-eth01.menu.DebugLevel.info=Info +wt32-eth01.menu.DebugLevel.info.build.code_debug=3 +wt32-eth01.menu.DebugLevel.debug=Debug +wt32-eth01.menu.DebugLevel.debug.build.code_debug=4 +wt32-eth01.menu.DebugLevel.verbose=Verbose +wt32-eth01.menu.DebugLevel.verbose.build.code_debug=5 + +############################################################## + bpi-bit.name=BPI-BIT bpi-bit.upload.tool=esptool_py @@ -8501,121 +8943,6 @@ wifiduino32.menu.DebugLevel.debug.build.code_debug=4 wifiduino32.menu.DebugLevel.verbose=Verbose wifiduino32.menu.DebugLevel.verbose.build.code_debug=5 -############################################################## - -ttgo-lora32-v21new.name=TTGO LoRa32-OLED v2.1.6 - -ttgo-lora32-v21new.upload.tool=esptool_py -ttgo-lora32-v21new.upload.maximum_size=1310720 -ttgo-lora32-v21new.upload.maximum_data_size=294912 -ttgo-lora32-v21new.upload.wait_for_upload_port=true -ttgo-lora32-v21new.upload.flags= -ttgo-lora32-v21new.upload.extra_flags= - -ttgo-lora32-v21new.serial.disableDTR=true -ttgo-lora32-v21new.serial.disableRTS=true - -ttgo-lora32-v21new.build.tarch=xtensa -ttgo-lora32-v21new.build.bootloader_addr=0x1000 -ttgo-lora32-v21new.build.target=esp32 -ttgo-lora32-v21new.build.mcu=esp32 -ttgo-lora32-v21new.build.core=esp32 -ttgo-lora32-v21new.build.variant=ttgo-lora32-v21new -ttgo-lora32-v21new.build.board=TTGO_LoRa32_v21new - -ttgo-lora32-v21new.build.f_cpu=240000000L -ttgo-lora32-v21new.build.flash_mode=dio -ttgo-lora32-v21new.build.flash_size=4MB -ttgo-lora32-v21new.build.boot=dio -ttgo-lora32-v21new.build.partitions=default - -ttgo-lora32-v21new.menu.FlashFreq.80=80MHz -ttgo-lora32-v21new.menu.FlashFreq.80.build.flash_freq=80m -ttgo-lora32-v21new.menu.FlashFreq.40=40MHz -ttgo-lora32-v21new.menu.FlashFreq.40.build.flash_freq=40m - -ttgo-lora32-v21new.menu.UploadSpeed.921600=921600 -ttgo-lora32-v21new.menu.UploadSpeed.921600.upload.speed=921600 -ttgo-lora32-v21new.menu.UploadSpeed.115200=115200 -ttgo-lora32-v21new.name=TTGO LoRa32-OLED v2.1.6 - -ttgo-lora32-v21new.upload.tool=esptool_py -ttgo-lora32-v21new.upload.maximum_size=1310720 -ttgo-lora32-v21new.upload.maximum_data_size=294912 -ttgo-lora32-v21new.upload.wait_for_upload_port=true - -ttgo-lora32-v21new.serial.disableDTR=true -ttgo-lora32-v21new.serial.disableRTS=true - -ttgo-lora32-v21new.build.tarch=xtensa -ttgo-lora32-v21new.build.bootloader_addr=0x1000 -ttgo-lora32-v21new.build.target=esp32 -ttgo-lora32-v21new.build.mcu=esp32 -ttgo-lora32-v21new.build.core=esp32 -ttgo-lora32-v21new.build.variant=ttgo-lora32-v21new -ttgo-lora32-v21new.build.board=TTGO_LoRa32_v21new - -ttgo-lora32-v21new.build.f_cpu=240000000L -ttgo-lora32-v21new.build.flash_mode=dio -ttgo-lora32-v21new.build.flash_size=4MB -ttgo-lora32-v21new.build.boot=dio -ttgo-lora32-v21new.build.partitions=default - -ttgo-lora32-v21new.menu.FlashFreq.80=80MHz -ttgo-lora32-v21new.menu.FlashFreq.80.build.flash_freq=80m -ttgo-lora32-v21new.menu.FlashFreq.40=40MHz -ttgo-lora32-v21new.menu.FlashFreq.40.build.flash_freq=40m - -ttgo-lora32-v21new.menu.UploadSpeed.921600=921600 -ttgo-lora32-v21new.menu.UploadSpeed.921600.upload.speed=921600 -ttgo-lora32-v21new.menu.UploadSpeed.115200=115200 -ttgo-lora32-v21new.menu.UploadSpeed.115200.upload.speed=115200 -ttgo-lora32-v21new.menu.UploadSpeed.256000.windows=256000 -ttgo-lora32-v21new.menu.UploadSpeed.256000.upload.speed=256000 -ttgo-lora32-v21new.menu.UploadSpeed.230400.windows.upload.speed=256000 -ttgo-lora32-v21new.menu.UploadSpeed.230400=230400 -ttgo-lora32-v21new.menu.UploadSpeed.230400.upload.speed=230400 -ttgo-lora32-v21new.menu.UploadSpeed.460800.linux=460800 -ttgo-lora32-v21new.menu.UploadSpeed.460800.macosx=460800 -ttgo-lora32-v21new.menu.UploadSpeed.460800.upload.speed=460800 -ttgo-lora32-v21new.menu.UploadSpeed.512000.windows=512000 -ttgo-lora32-v21new.menu.UploadSpeed.512000.upload.speed=512000 - -ttgo-lora32-v21new.menu.DebugLevel.none=None -ttgo-lora32-v21new.menu.DebugLevel.none.build.code_debug=0 -ttgo-lora32-v21new.menu.DebugLevel.error=Error -ttgo-lora32-v21new.menu.DebugLevel.error.build.code_debug=1 -ttgo-lora32-v21new.menu.DebugLevel.warn=Warn -ttgo-lora32-v21new.menu.DebugLevel.warn.build.code_debug=2 -ttgo-lora32-v21new.menu.DebugLevel.info=Info -ttgo-lora32-v21new.menu.DebugLevel.info.build.code_debug=3 -ttgo-lora32-v21new.menu.DebugLevel.debug=Debug -ttgo-lora32-v21new.menu.DebugLevel.debug.build.code_debug=4 -ttgo-lora32-v21new.menu.DebugLevel.verbose=Verbose -ttgo-lora32-v21new.menu.DebugLevel.verbose.build.code_debug=5w.menu.UploadSpeed.115200.upload.speed=115200 -ttgo-lora32-v21new.menu.UploadSpeed.256000.windows=256000 -ttgo-lora32-v21new.menu.UploadSpeed.256000.upload.speed=256000 -ttgo-lora32-v21new.menu.UploadSpeed.230400.windows.upload.speed=256000 -ttgo-lora32-v21new.menu.UploadSpeed.230400=230400 -ttgo-lora32-v21new.menu.UploadSpeed.230400.upload.speed=230400 -ttgo-lora32-v21new.menu.UploadSpeed.460800.linux=460800 -ttgo-lora32-v21new.menu.UploadSpeed.460800.macosx=460800 -ttgo-lora32-v21new.menu.UploadSpeed.460800.upload.speed=460800 -ttgo-lora32-v21new.menu.UploadSpeed.512000.windows=512000 -ttgo-lora32-v21new.menu.UploadSpeed.512000.upload.speed=512000 - -ttgo-lora32-v21new.menu.DebugLevel.none=None -ttgo-lora32-v21new.menu.DebugLevel.none.build.code_debug=0 -ttgo-lora32-v21new.menu.DebugLevel.error=Error -ttgo-lora32-v21new.menu.DebugLevel.error.build.code_debug=1 -ttgo-lora32-v21new.menu.DebugLevel.warn=Warn -ttgo-lora32-v21new.menu.DebugLevel.warn.build.code_debug=2 -ttgo-lora32-v21new.menu.DebugLevel.info=Info -ttgo-lora32-v21new.menu.DebugLevel.info.build.code_debug=3 -ttgo-lora32-v21new.menu.DebugLevel.debug=Debug -ttgo-lora32-v21new.menu.DebugLevel.debug.build.code_debug=4 -ttgo-lora32-v21new.menu.DebugLevel.verbose=Verbose -ttgo-lora32-v21new.menu.DebugLevel.verbose.build.code_debug=5 ############################################################## @@ -9126,13 +9453,15 @@ kb32.name=KB32-FT kb32.upload.tool=esptool_py kb32.upload.maximum_size=1310720 kb32.upload.maximum_data_size=327680 -kb32.upload.wait_for_upload_port=true kb32.upload.flags= kb32.upload.extra_flags= kb32.serial.disableDTR=true kb32.serial.disableRTS=true +kb32.build.tarch=xtensa +kb32.build.bootloader_addr=0x1000 +kb32.build.target=esp32 kb32.build.mcu=esp32 kb32.build.core=esp32 kb32.build.variant=esp32 @@ -9145,13 +9474,15 @@ kb32.build.flash_mode=dio kb32.build.boot=dio kb32.build.partitions=default kb32.build.defines= +kb32.build.loop_core= +kb32.build.event_core= kb32.menu.PSRAM.disabled=Disabled kb32.menu.PSRAM.disabled.build.defines= kb32.menu.PSRAM.disabled.build.extra_libs= kb32.menu.PSRAM.enabled=Enabled -kb32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -kb32.menu.PSRAM.enabled.build.extra_libs=-lc-psram-workaround -lm-psram-workaround +kb32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw +kb32.menu.PSRAM.enabled.build.extra_libs= kb32.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) kb32.menu.PartitionScheme.default.build.partitions=default @@ -9186,6 +9517,9 @@ kb32.menu.PartitionScheme.fatflash.upload.maximum_size=2097152 kb32.menu.PartitionScheme.app3M_fat9M_16MB=16M Flash (3MB APP/9MB FATFS) kb32.menu.PartitionScheme.app3M_fat9M_16MB.build.partitions=app3M_fat9M_16MB kb32.menu.PartitionScheme.app3M_fat9M_16MB.upload.maximum_size=3145728 +kb32.menu.PartitionScheme.rainmaker=RainMaker +kb32.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +kb32.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 kb32.menu.CPUFreq.240=240MHz (WiFi/BT) kb32.menu.CPUFreq.240.build.f_cpu=240000000L @@ -9248,6 +9582,16 @@ kb32.menu.UploadSpeed.460800.upload.speed=460800 kb32.menu.UploadSpeed.512000.windows=512000 kb32.menu.UploadSpeed.512000.upload.speed=512000 +kb32.menu.LoopCore.1=Core 1 +kb32.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1 +kb32.menu.LoopCore.0=Core 0 +kb32.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0 + +kb32.menu.EventsCore.1=Core 1 +kb32.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1 +kb32.menu.EventsCore.0=Core 0 +kb32.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0 + kb32.menu.DebugLevel.none=None kb32.menu.DebugLevel.none.build.code_debug=0 kb32.menu.DebugLevel.error=Error @@ -9329,7 +9673,7 @@ deneyapkart.menu.CPUFreq.80=80MHz (WiFi/BT) deneyapkart.menu.CPUFreq.80.build.f_cpu=80000000L deneyapkart.menu.CPUFreq.40=40MHz deneyapkart.menu.CPUFreq.40.build.f_cpu=40000000L -deneyapkart.menu.CPUFreq.20=20MHz +deneyapkart.menu.CPUFreq.20=20MHz deneyapkart.menu.CPUFreq.20.build.f_cpu=20000000L deneyapkart.menu.CPUFreq.10=10MHz deneyapkart.menu.CPUFreq.10.build.f_cpu=10000000L @@ -9690,10 +10034,20 @@ deneyapmini.build.boot=qio deneyapmini.build.partitions=default deneyapmini.build.defines= -deneyapmini.menu.CDCOnBoot.default=Disabled -deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=0 -deneyapmini.menu.CDCOnBoot.cdc=Enabled -deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=1 +deneyapmini.menu.CDCOnBoot.default=Enabled +deneyapmini.menu.CDCOnBoot.default.build.cdc_on_boot=1 +deneyapmini.menu.CDCOnBoot.cdc=Disabled +deneyapmini.menu.CDCOnBoot.cdc.build.cdc_on_boot=0 + +deneyapmini.menu.MSCOnBoot.default=Disabled +deneyapmini.menu.MSCOnBoot.default.build.msc_on_boot=0 +deneyapmini.menu.MSCOnBoot.msc=Enabled +deneyapmini.menu.MSCOnBoot.msc.build.msc_on_boot=1 + +deneyapmini.menu.DFUOnBoot.default=Disabled +deneyapmini.menu.DFUOnBoot.default.build.dfu_on_boot=0 +deneyapmini.menu.DFUOnBoot.dfu=Enabled +deneyapmini.menu.DFUOnBoot.dfu.build.dfu_on_boot=1 deneyapmini.menu.PSRAM.disabled=Disabled deneyapmini.menu.PSRAM.disabled.build.defines= @@ -10008,3 +10362,213 @@ franzininho_wifi_msc_esp32s2.menu.DebugLevel.verbose=Verbose franzininho_wifi_msc_esp32s2.menu.DebugLevel.verbose.build.code_debug=5 ############################################################## + +dpu_esp32.name=DPU ESP32 + +dpu_esp32.upload.tool=esptool_py +dpu_esp32.upload.maximum_size=3342336 +dpu_esp32.upload.maximum_data_size=327680 +dpu_esp32.upload.flags= +dpu_esp32.upload.extra_flags= + +dpu_esp32.serial.disableDTR=true +dpu_esp32.serial.disableRTS=true + +dpu_esp32.build.tarch=xtensa +dpu_esp32.build.bootloader_addr=0x1000 +dpu_esp32.build.target=esp32 +dpu_esp32.build.mcu=esp32 +dpu_esp32.build.core=esp32 +dpu_esp32.build.variant=dpu_esp32 +dpu_esp32.build.board=DPU_ESP32 + +dpu_esp32.build.f_cpu=240000000L +dpu_esp32.build.flash_size=8MB +dpu_esp32.build.flash_freq=40m +dpu_esp32.build.flash_mode=dio +dpu_esp32.build.boot=dio +dpu_esp32.build.partitions=default_8MB +dpu_esp32.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-strategy=memw +dpu_esp32.build.extra_libs= + +dpu_esp32.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS) +dpu_esp32.menu.PartitionScheme.default.build.partitions=default +dpu_esp32.menu.PartitionScheme.default.upload.maximum_size=1310720 +dpu_esp32.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS) +dpu_esp32.menu.PartitionScheme.defaultffat.build.partitions=default_ffat +dpu_esp32.menu.PartitionScheme.defaultffat.upload.maximum_size=1310720 +dpu_esp32.menu.PartitionScheme.default_8MB=8M Flash (3MB APP/1.5MB FAT) +dpu_esp32.menu.PartitionScheme.default_8MB.build.partitions=default_8MB +dpu_esp32.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336 +dpu_esp32.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS) +dpu_esp32.menu.PartitionScheme.minimal.build.partitions=minimal +dpu_esp32.menu.PartitionScheme.minimal.upload.maximum_size=1310720 +dpu_esp32.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS) +dpu_esp32.menu.PartitionScheme.no_ota.build.partitions=no_ota +dpu_esp32.menu.PartitionScheme.no_ota.upload.maximum_size=2097152 +dpu_esp32.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS) +dpu_esp32.menu.PartitionScheme.noota_3g.build.partitions=noota_3g +dpu_esp32.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576 +dpu_esp32.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS) +dpu_esp32.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat +dpu_esp32.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152 +dpu_esp32.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS) +dpu_esp32.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat +dpu_esp32.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576 +dpu_esp32.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS) +dpu_esp32.menu.PartitionScheme.huge_app.build.partitions=huge_app +dpu_esp32.menu.PartitionScheme.huge_app.upload.maximum_size=3145728 +dpu_esp32.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS) +dpu_esp32.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs +dpu_esp32.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080 +dpu_esp32.menu.PartitionScheme.fatflash=16M Flash (2MB APP/12.5MB FAT) +dpu_esp32.menu.PartitionScheme.fatflash.build.partitions=ffat + +dpu_esp32.menu.FlashMode.qio=QIO +dpu_esp32.menu.FlashMode.qio.build.flash_mode=dio +dpu_esp32.menu.FlashMode.qio.build.boot=qio +dpu_esp32.menu.FlashMode.dio=DIO +dpu_esp32.menu.FlashMode.dio.build.flash_mode=dio +dpu_esp32.menu.FlashMode.dio.build.boot=dio +dpu_esp32.menu.FlashMode.qout=QOUT +dpu_esp32.menu.FlashMode.qout.build.flash_mode=dout +dpu_esp32.menu.FlashMode.qout.build.boot=qout +dpu_esp32.menu.FlashMode.dout=DOUT +dpu_esp32.menu.FlashMode.dout.build.flash_mode=dout +dpu_esp32.menu.FlashMode.dout.build.boot=dout + +dpu_esp32.menu.FlashFreq.80=80MHz +dpu_esp32.menu.FlashFreq.80.build.flash_freq=80m +dpu_esp32.menu.FlashFreq.40=40MHz +dpu_esp32.menu.FlashFreq.40.build.flash_freq=40m + +dpu_esp32.menu.UploadSpeed.921600=921600 +dpu_esp32.menu.UploadSpeed.921600.upload.speed=921600 +dpu_esp32.menu.UploadSpeed.115200=115200 +dpu_esp32.menu.UploadSpeed.115200.upload.speed=115200 +dpu_esp32.menu.UploadSpeed.256000.windows=256000 +dpu_esp32.menu.UploadSpeed.256000.upload.speed=256000 +dpu_esp32.menu.UploadSpeed.230400.windows.upload.speed=256000 +dpu_esp32.menu.UploadSpeed.230400=230400 +dpu_esp32.menu.UploadSpeed.230400.upload.speed=230400 +dpu_esp32.menu.UploadSpeed.460800.linux=460800 +dpu_esp32.menu.UploadSpeed.460800.macosx=460800 +dpu_esp32.menu.UploadSpeed.460800.upload.speed=460800 +dpu_esp32.menu.UploadSpeed.512000.windows=512000 +dpu_esp32.menu.UploadSpeed.512000.upload.speed=512000 + +dpu_esp32.menu.DebugLevel.none=None +dpu_esp32.menu.DebugLevel.none.build.code_debug=0 +dpu_esp32.menu.DebugLevel.error=Error +dpu_esp32.menu.DebugLevel.error.build.code_debug=1 +dpu_esp32.menu.DebugLevel.warn=Warn +dpu_esp32.menu.DebugLevel.warn.build.code_debug=2 +dpu_esp32.menu.DebugLevel.info=Info +dpu_esp32.menu.DebugLevel.info.build.code_debug=3 +dpu_esp32.menu.DebugLevel.debug=Debug +dpu_esp32.menu.DebugLevel.debug.build.code_debug=4 +dpu_esp32.menu.DebugLevel.verbose=Verbose +dpu_esp32.menu.DebugLevel.verbose.build.code_debug=5 + +############################################################## + +sonoff_dualr3.name=Sonoff DUALR3 + +sonoff_dualr3.upload.tool=esptool_py +sonoff_dualr3.upload.maximum_size=1310720 +sonoff_dualr3.upload.maximum_data_size=327680 +sonoff_dualr3.upload.flags= +sonoff_dualr3.upload.extra_flags= + +sonoff_dualr3.serial.disableDTR=true +sonoff_dualr3.serial.disableRTS=true + +sonoff_dualr3.build.tarch=xtensa +sonoff_dualr3.build.bootloader_addr=0x1000 +sonoff_dualr3.build.target=esp32 +sonoff_dualr3.build.mcu=esp32 +sonoff_dualr3.build.core=esp32 +sonoff_dualr3.build.variant=esp32 +sonoff_dualr3.build.board=SONOFF_DUALR3 + +sonoff_dualr3.build.f_cpu=240000000L +sonoff_dualr3.build.flash_size=4MB +sonoff_dualr3.build.flash_freq=40m +sonoff_dualr3.build.flash_mode=dio +sonoff_dualr3.build.boot=dio +sonoff_dualr3.build.partitions=rainmaker +sonoff_dualr3.build.defines= +sonoff_dualr3.build.loop_core= +sonoff_dualr3.build.event_core= + +sonoff_dualr3.menu.PartitionScheme.rainmaker=RainMaker +sonoff_dualr3.menu.PartitionScheme.rainmaker.build.partitions=rainmaker +sonoff_dualr3.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728 + +sonoff_dualr3.menu.CPUFreq.240=240MHz (WiFi/BT) +sonoff_dualr3.menu.CPUFreq.240.build.f_cpu=240000000L +sonoff_dualr3.menu.CPUFreq.160=160MHz (WiFi/BT) +sonoff_dualr3.menu.CPUFreq.160.build.f_cpu=160000000L +sonoff_dualr3.menu.CPUFreq.80=80MHz (WiFi/BT) +sonoff_dualr3.menu.CPUFreq.80.build.f_cpu=80000000L +sonoff_dualr3.menu.CPUFreq.40=40MHz (40MHz XTAL) +sonoff_dualr3.menu.CPUFreq.40.build.f_cpu=40000000L +sonoff_dualr3.menu.CPUFreq.26=26MHz (26MHz XTAL) +sonoff_dualr3.menu.CPUFreq.26.build.f_cpu=26000000L +sonoff_dualr3.menu.CPUFreq.20=20MHz (40MHz XTAL) +sonoff_dualr3.menu.CPUFreq.20.build.f_cpu=20000000L +sonoff_dualr3.menu.CPUFreq.13=13MHz (26MHz XTAL) +sonoff_dualr3.menu.CPUFreq.13.build.f_cpu=13000000L +sonoff_dualr3.menu.CPUFreq.10=10MHz (40MHz XTAL) +sonoff_dualr3.menu.CPUFreq.10.build.f_cpu=10000000L + +sonoff_dualr3.menu.FlashMode.qio=QIO +sonoff_dualr3.menu.FlashMode.qio.build.flash_mode=dio +sonoff_dualr3.menu.FlashMode.qio.build.boot=qio +sonoff_dualr3.menu.FlashMode.dio=DIO +sonoff_dualr3.menu.FlashMode.dio.build.flash_mode=dio +sonoff_dualr3.menu.FlashMode.dio.build.boot=dio +sonoff_dualr3.menu.FlashMode.qout=QOUT +sonoff_dualr3.menu.FlashMode.qout.build.flash_mode=dout +sonoff_dualr3.menu.FlashMode.qout.build.boot=qout +sonoff_dualr3.menu.FlashMode.dout=DOUT +sonoff_dualr3.menu.FlashMode.dout.build.flash_mode=dout +sonoff_dualr3.menu.FlashMode.dout.build.boot=dout + +sonoff_dualr3.menu.FlashFreq.80=80MHz +sonoff_dualr3.menu.FlashFreq.80.build.flash_freq=80m +sonoff_dualr3.menu.FlashFreq.40=40MHz +sonoff_dualr3.menu.FlashFreq.40.build.flash_freq=40m + +sonoff_dualr3.menu.FlashSize.4M=4MB (32Mb) +sonoff_dualr3.menu.FlashSize.4M.build.flash_size=4MB + +sonoff_dualr3.menu.UploadSpeed.921600=921600 +sonoff_dualr3.menu.UploadSpeed.921600.upload.speed=921600 +sonoff_dualr3.menu.UploadSpeed.115200=115200 +sonoff_dualr3.menu.UploadSpeed.115200.upload.speed=115200 +sonoff_dualr3.menu.UploadSpeed.256000.windows=256000 +sonoff_dualr3.menu.UploadSpeed.256000.upload.speed=256000 +sonoff_dualr3.menu.UploadSpeed.230400.windows.upload.speed=256000 +sonoff_dualr3.menu.UploadSpeed.230400=230400 +sonoff_dualr3.menu.UploadSpeed.230400.upload.speed=230400 +sonoff_dualr3.menu.UploadSpeed.460800.linux=460800 +sonoff_dualr3.menu.UploadSpeed.460800.macosx=460800 +sonoff_dualr3.menu.UploadSpeed.460800.upload.speed=460800 +sonoff_dualr3.menu.UploadSpeed.512000.windows=512000 +sonoff_dualr3.menu.UploadSpeed.512000.upload.speed=512000 + +sonoff_dualr3.menu.DebugLevel.none=None +sonoff_dualr3.menu.DebugLevel.none.build.code_debug=0 +sonoff_dualr3.menu.DebugLevel.error=Error +sonoff_dualr3.menu.DebugLevel.error.build.code_debug=1 +sonoff_dualr3.menu.DebugLevel.warn=Warn +sonoff_dualr3.menu.DebugLevel.warn.build.code_debug=2 +sonoff_dualr3.menu.DebugLevel.info=Info +sonoff_dualr3.menu.DebugLevel.info.build.code_debug=3 +sonoff_dualr3.menu.DebugLevel.debug=Debug +sonoff_dualr3.menu.DebugLevel.debug.build.code_debug=4 +sonoff_dualr3.menu.DebugLevel.verbose=Verbose +sonoff_dualr3.menu.DebugLevel.verbose.build.code_debug=5 + +############################################################## diff --git a/cores/esp32/Arduino.h b/cores/esp32/Arduino.h index 71ffe75197e..8014d3c8342 100644 --- a/cores/esp32/Arduino.h +++ b/cores/esp32/Arduino.h @@ -179,6 +179,9 @@ uint16_t makeWord(uint8_t h, uint8_t l); #define word(...) makeWord(__VA_ARGS__) +size_t getArduinoLoopTaskStackSize(void); +#define SET_LOOP_TASK_STACK_SIZE(sz) size_t getArduinoLoopTaskStackSize() { return sz;} + unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L); unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L); diff --git a/cores/esp32/MD5Builder.cpp b/cores/esp32/MD5Builder.cpp index f2168f4e6c4..c988abd1e05 100644 --- a/cores/esp32/MD5Builder.cpp +++ b/cores/esp32/MD5Builder.cpp @@ -19,7 +19,7 @@ #include #include -uint8_t hex_char_to_byte(uint8_t c) +static uint8_t hex_char_to_byte(uint8_t c) { return (c >= 'a' && c <= 'f') ? (c - ((uint8_t)'a' - 0xa)) : (c >= 'A' && c <= 'F') ? (c - ((uint8_t)'A' - 0xA)) : @@ -28,13 +28,13 @@ uint8_t hex_char_to_byte(uint8_t c) void MD5Builder::begin(void) { - memset(_buf, 0x00, 16); - MD5Init(&_ctx); + memset(_buf, 0x00, ESP_ROM_MD5_DIGEST_LEN); + esp_rom_md5_init(&_ctx); } void MD5Builder::add(uint8_t * data, uint16_t len) { - MD5Update(&_ctx, data, len); + esp_rom_md5_update(&_ctx, data, len); } void MD5Builder::addHexString(const char * data) @@ -82,7 +82,7 @@ bool MD5Builder::addStream(Stream & stream, const size_t maxLen) } // Update MD5 with buffer payload - MD5Update(&_ctx, buf, numBytesRead); + esp_rom_md5_update(&_ctx, buf, numBytesRead); // update available number of bytes maxLengthLeft -= numBytesRead; @@ -94,24 +94,24 @@ bool MD5Builder::addStream(Stream & stream, const size_t maxLen) void MD5Builder::calculate(void) { - MD5Final(_buf, &_ctx); + esp_rom_md5_final(_buf, &_ctx); } void MD5Builder::getBytes(uint8_t * output) { - memcpy(output, _buf, 16); + memcpy(output, _buf, ESP_ROM_MD5_DIGEST_LEN); } void MD5Builder::getChars(char * output) { - for(uint8_t i = 0; i < 16; i++) { + for(uint8_t i = 0; i < ESP_ROM_MD5_DIGEST_LEN; i++) { sprintf(output + (i * 2), "%02x", _buf[i]); } } String MD5Builder::toString(void) { - char out[33]; + char out[(ESP_ROM_MD5_DIGEST_LEN * 2) + 1]; getChars(out); return String(out); } diff --git a/cores/esp32/MD5Builder.h b/cores/esp32/MD5Builder.h index 2588a74daec..4285384e384 100644 --- a/cores/esp32/MD5Builder.h +++ b/cores/esp32/MD5Builder.h @@ -23,25 +23,13 @@ #include #include "esp_system.h" -#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ -#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 -#include "esp32/rom/md5_hash.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/rom/md5_hash.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/rom/md5_hash.h" -#else -#error Target CONFIG_IDF_TARGET is not supported -#endif -#else // ESP32 Before IDF 4.0 -#include "rom/md5_hash.h" -#endif +#include "esp_rom_md5.h" class MD5Builder { private: - struct MD5Context _ctx; - uint8_t _buf[16]; + md5_context_t _ctx; + uint8_t _buf[ESP_ROM_MD5_DIGEST_LEN]; public: void begin(void); void add(uint8_t * data, uint16_t len); diff --git a/cores/esp32/cbuf.h b/cores/esp32/cbuf.h index ca65affcce9..490352e3202 100644 --- a/cores/esp32/cbuf.h +++ b/cores/esp32/cbuf.h @@ -62,7 +62,7 @@ class cbuf cbuf *next; -private: +protected: inline char* wrap_if_bufend(char* ptr) const { return (ptr == _bufend) ? _buf : ptr; diff --git a/cores/esp32/esp32-hal-dac.c b/cores/esp32/esp32-hal-dac.c index 30a08a71aa7..db1bb74b4d8 100644 --- a/cores/esp32/esp32-hal-dac.c +++ b/cores/esp32/esp32-hal-dac.c @@ -13,51 +13,37 @@ // limitations under the License. #include "esp32-hal.h" +#include "soc/soc_caps.h" -#if CONFIG_IDF_TARGET_ESP32 -#include "soc/rtc_io_reg.h" -#define DAC1 25 -#define DAC2 26 -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "soc/rtc_io_reg.h" -#define DAC1 17 -#define DAC2 18 -#elif CONFIG_IDF_TARGET_ESP32C3 +#ifndef SOC_DAC_SUPPORTED #define NODAC #else -#error Target CONFIG_IDF_TARGET is not supported -#endif - -#ifndef NODAC -#include "esp_attr.h" -#include "soc/rtc_cntl_reg.h" -#include "soc/rtc_io_periph.h" -#include "soc/sens_reg.h" -#include "soc/sens_struct.h" -#include "driver/dac.h" +#include "soc/dac_channel.h" +#include "driver/dac_common.h" void ARDUINO_ISR_ATTR __dacWrite(uint8_t pin, uint8_t value) { - if(pin < DAC1 || pin > DAC2){ + if(pin < DAC_CHANNEL_1_GPIO_NUM || pin > DAC_CHANNEL_2_GPIO_NUM){ return;//not dac pin } - pinMode(pin, ANALOG); - uint8_t channel = pin - DAC1; -#if CONFIG_IDF_TARGET_ESP32 - CLEAR_PERI_REG_MASK(SENS_SAR_DAC_CTRL1_REG, SENS_SW_TONE_EN); -#elif CONFIG_IDF_TARGET_ESP32S2 - SENS.sar_dac_ctrl1.dac_clkgate_en = 1; -#endif - RTCIO.pad_dac[channel].dac_xpd_force = 1; - RTCIO.pad_dac[channel].xpd_dac = 1; - if (channel == 0) { - SENS.sar_dac_ctrl2.dac_cw_en1 = 0; - } else if (channel == 1) { - SENS.sar_dac_ctrl2.dac_cw_en2 = 0; + + uint8_t channel = pin - DAC_CHANNEL_1_GPIO_NUM; + dac_output_enable(channel); + dac_output_voltage(channel, value); + +} + +void ARDUINO_ISR_ATTR __dacDisable(uint8_t pin) +{ + if(pin < DAC_CHANNEL_1_GPIO_NUM || pin > DAC_CHANNEL_2_GPIO_NUM){ + return;//not dac pin } - RTCIO.pad_dac[channel].dac = value; + + uint8_t channel = pin - DAC_CHANNEL_1_GPIO_NUM; + dac_output_disable(channel); } extern void dacWrite(uint8_t pin, uint8_t value) __attribute__ ((weak, alias("__dacWrite"))); +extern void dacDisable(uint8_t pin) __attribute__ ((weak, alias("__dacDisable"))); #endif diff --git a/cores/esp32/esp32-hal-dac.h b/cores/esp32/esp32-hal-dac.h index 47b2265800f..cafab073ab8 100644 --- a/cores/esp32/esp32-hal-dac.h +++ b/cores/esp32/esp32-hal-dac.h @@ -28,6 +28,7 @@ extern "C" { #include "driver/gpio.h" void dacWrite(uint8_t pin, uint8_t value); +void dacDisable(uint8_t pin); #ifdef __cplusplus } diff --git a/cores/esp32/esp32-hal-gpio.c b/cores/esp32/esp32-hal-gpio.c index f0eb4dec7db..552126b848d 100644 --- a/cores/esp32/esp32-hal-gpio.c +++ b/cores/esp32/esp32-hal-gpio.c @@ -37,7 +37,13 @@ #include "soc/periph_defs.h" #include "soc/rtc_io_reg.h" #define GPIO_FUNC 1 -#else +#elif CONFIG_IDF_TARGET_ESP32C3 +#include "esp32c3/rom/ets_sys.h" +#include "esp32c3/rom/gpio.h" +#include "esp_intr_alloc.h" +#include "soc/periph_defs.h" +#define USE_ESP_IDF_GPIO 1 +#else #define USE_ESP_IDF_GPIO 1 #endif #else // ESP32 Before IDF 4.0 @@ -143,6 +149,29 @@ const DRAM_ATTR esp32_gpioMux_t esp32_gpioMux[SOC_GPIO_PIN_COUNT]={ {0xb8, -1, -1, -1},//SCL? {0xbc, -1, -1, -1},//INPUT ONLY {0, -1, -1, -1} +#elif CONFIG_IDF_TARGET_ESP32C3 + {0x04, -1, 0, -1}, // ADC1_CH0 + {0x08, -1, 1, -1}, // ADC1_CH1 + {0x0c, -1, 2, -1}, // ADC1_CH2 | FSPIQ + {0x10, -1, 3, -1}, // ADC1_CH3 + {0x14, -1, 4, -1}, // MTMS | ADC1_CH4 | FSPIHD + {0x18, -1, 5, -1}, // MTDI | ADC2_CH0 | FSPIWP + {0x1c, -1, -1, -1}, // MTCK | FSPICLK + {0x20, -1, -1, -1}, // MTDO | FSPID + {0x24, -1, -1, -1}, // + {0x28, -1, -1, -1}, // + {0x2c, -1, -1, -1}, // FSPICSO + {0x30, -1, -1, -1}, // + {0x34, -1, -1, -1}, // SPIHD + {0x38, -1, -1, -1}, // SPIWP + {0x3c, -1, -1, -1}, // SPICSO + {0x40, -1, -1, -1}, // SPICLK + {0x44, -1, -1, -1}, // SPID + {0x48, -1, -1, -1}, // SPIQ + {0x4c, -1, -1, -1}, // USB- + {0x50, -1, -1, -1}, // USB+ + {0x54, -1, -1, -1}, // U0RXD + {0x58, -1, -1, -1}, // U0TXD #endif }; @@ -481,4 +510,3 @@ extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead") extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt"))); extern void attachInterruptArg(uint8_t pin, voidFuncPtrArg handler, void * arg, int mode) __attribute__ ((weak, alias("__attachInterruptArg"))); extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt"))); - diff --git a/cores/esp32/esp32-hal-i2c-slave.c b/cores/esp32/esp32-hal-i2c-slave.c old mode 100755 new mode 100644 index 458b74f2cb0..49da0c82b0d --- a/cores/esp32/esp32-hal-i2c-slave.c +++ b/cores/esp32/esp32-hal-i2c-slave.c @@ -302,7 +302,7 @@ esp_err_t i2cSlaveInit(uint8_t num, int sda, int scl, uint16_t slaveID, uint32_t i2c_ll_slave_init(i2c->dev); i2c_ll_set_fifo_mode(i2c->dev, true); i2c_ll_set_slave_addr(i2c->dev, slaveID, false); - i2c_ll_set_tout(i2c->dev, 32000); + i2c_ll_set_tout(i2c->dev, I2C_LL_MAX_TIMEOUT); i2c_slave_set_frequency(i2c, frequency); if (!i2c_slave_check_line_state(sda, scl)) { diff --git a/cores/esp32/esp32-hal-i2c-slave.h b/cores/esp32/esp32-hal-i2c-slave.h old mode 100755 new mode 100644 diff --git a/cores/esp32/esp32-hal-i2c.c b/cores/esp32/esp32-hal-i2c.c index 18ef4c115e7..c4ec85e732c 100644 --- a/cores/esp32/esp32-hal-i2c.c +++ b/cores/esp32/esp32-hal-i2c.c @@ -24,6 +24,7 @@ #include "soc/soc_caps.h" #include "soc/i2c_periph.h" #include "hal/i2c_hal.h" +#include "hal/i2c_ll.h" #include "driver/i2c.h" typedef volatile struct { @@ -91,6 +92,8 @@ esp_err_t i2cInit(uint8_t i2c_num, int8_t sda, int8_t scl, uint32_t frequency){ } else { bus[i2c_num].initialized = true; bus[i2c_num].frequency = frequency; + //Clock Stretching Timeout: 20b:esp32, 5b:esp32-c3, 24b:esp32-s2 + i2c_set_timeout((i2c_port_t)i2c_num, I2C_LL_MAX_TIMEOUT); } } #if !CONFIG_DISABLE_HAL_LOCKS diff --git a/cores/esp32/esp32-hal-ledc.c b/cores/esp32/esp32-hal-ledc.c index 4e20e7b8bd4..6274ed0708c 100644 --- a/cores/esp32/esp32-hal-ledc.c +++ b/cores/esp32/esp32-hal-ledc.c @@ -13,46 +13,25 @@ // limitations under the License. #include "esp32-hal.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "esp32-hal-matrix.h" #include "soc/soc_caps.h" -#include "soc/ledc_reg.h" -#include "soc/ledc_struct.h" -#include "driver/periph_ctrl.h" +#include "driver/ledc.h" -#include "esp_system.h" -#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ -#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 -#include "soc/dport_reg.h" -#include "esp32/rom/ets_sys.h" -#define LAST_CHAN (15) -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "soc/dport_reg.h" -#include "esp32s2/rom/ets_sys.h" -#define LAST_CHAN (7) -#define LEDC_DIV_NUM_HSTIMER0_V LEDC_CLK_DIV_LSTIMER0_V -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/rom/ets_sys.h" -#define LAST_CHAN (7) -#define LEDC_DIV_NUM_HSTIMER0_V LEDC_CLK_DIV_LSTIMER0_V -#else -#error Target CONFIG_IDF_TARGET is not supported -#endif -#else // ESP32 Before IDF 4.0 -#include "rom/ets_sys.h" +#ifdef SOC_LEDC_SUPPORT_HS_MODE +#define LEDC_CHANNELS (SOC_LEDC_CHANNEL_NUM<<1) +#else +#define LEDC_CHANNELS (SOC_LEDC_CHANNEL_NUM) #endif -#if CONFIG_DISABLE_HAL_LOCKS -#define LEDC_MUTEX_LOCK() -#define LEDC_MUTEX_UNLOCK() +//Use XTAL clock if possible to avoid timer frequency error when setting APB clock < 80 Mhz +//Need to be fixed in ESP-IDF +#ifdef SOC_LEDC_SUPPORT_XTAL_CLOCK +#define LEDC_DEFAULT_CLK LEDC_USE_XTAL_CLK #else -#define LEDC_MUTEX_LOCK() do {} while (xSemaphoreTake(_ledc_sys_lock, portMAX_DELAY) != pdPASS) -#define LEDC_MUTEX_UNLOCK() xSemaphoreGive(_ledc_sys_lock) -xSemaphoreHandle _ledc_sys_lock = NULL; +#define LEDC_DEFAULT_CLK LEDC_AUTO_CLK #endif +#define LEDC_MAX_BIT_WIDTH SOC_LEDC_TIMER_BIT_WIDE_NUM + /* * LEDC Chan to Group/Channel/Timer Mapping ** ledc: 0 => Group: 0, Channel: 0, Timer: 0 @@ -72,203 +51,55 @@ xSemaphoreHandle _ledc_sys_lock = NULL; ** ledc: 14 => Group: 1, Channel: 6, Timer: 3 ** ledc: 15 => Group: 1, Channel: 7, Timer: 3 */ -#define LEDC_CHAN(g,c) LEDC.channel_group[(g)].channel[(c)] -#define LEDC_TIMER(g,t) LEDC.timer_group[(g)].timer[(t)] -static void _on_apb_change(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb){ - if(ev_type == APB_AFTER_CHANGE && old_apb != new_apb){ - uint16_t iarg = *(uint16_t*)arg; - uint8_t chan = 0; - old_apb /= 1000000; - new_apb /= 1000000; - while(iarg){ // run though all active channels, adjusting timing configurations - if(iarg & 1) {// this channel is active - uint8_t group=(chan/8), timer=((chan/2)%4); - if(LEDC_TIMER(group, timer).conf.tick_sel){ - LEDC_MUTEX_LOCK(); - uint32_t old_div = LEDC_TIMER(group, timer).conf.clock_divider; - uint32_t div_num = (new_apb * old_div) / old_apb; - if(div_num > LEDC_DIV_NUM_HSTIMER0_V){ - div_num = ((REF_CLK_FREQ /1000000) * old_div) / old_apb; - if(div_num > LEDC_DIV_NUM_HSTIMER0_V) { - div_num = LEDC_DIV_NUM_HSTIMER0_V;//lowest clock possible - } - LEDC_TIMER(group, timer).conf.tick_sel = 0; - } else if(div_num < 256) { - div_num = 256;//highest clock possible - } - LEDC_TIMER(group, timer).conf.clock_divider = div_num; - LEDC_MUTEX_UNLOCK(); - } - else { - log_d("using REF_CLK chan=%d",chan); - } - } - iarg = iarg >> 1; - chan++; - } - } -} +uint8_t channels_resolution[LEDC_CHANNELS] = {0}; -//uint32_t frequency = (80MHz or 1MHz)/((div_num / 256.0)*(1 << bit_num)); -static void _ledcSetupTimer(uint8_t chan, uint32_t div_num, uint8_t bit_num, bool apb_clk) -{ - uint8_t group=(chan/8), timer=((chan/2)%4); - static bool tHasStarted = false; - static uint16_t _activeChannels = 0; -#if CONFIG_IDF_TARGET_ESP32S2 -// ESP32-S2 TRM v1.0 on Page 789 -> BIT LEDC_TICK_SEL_TIMERx is 0 for LEDC_PWM_CLK and 1 for REF_TICK - apb_clk = 0; -#endif - if(!tHasStarted) { - tHasStarted = true; - periph_module_enable(PERIPH_LEDC_MODULE); - LEDC.conf.apb_clk_sel = 1;//LS use apb clock - addApbChangeCallback((void*)&_activeChannels, _on_apb_change); - -#if !CONFIG_DISABLE_HAL_LOCKS - _ledc_sys_lock = xSemaphoreCreateMutex(); -#endif - } - LEDC_MUTEX_LOCK(); - LEDC_TIMER(group, timer).conf.clock_divider = div_num;//18 bit (10.8) This register is used to configure parameter for divider in timer the least significant eight bits represent the decimal part. - LEDC_TIMER(group, timer).conf.duty_resolution = bit_num;//5 bit This register controls the range of the counter in timer. the counter range is [0 2**bit_num] the max bit width for counter is 20. - LEDC_TIMER(group, timer).conf.tick_sel = apb_clk;//apb clock -#if CONFIG_IDF_TARGET_ESP32 - if(group) { -#endif - LEDC_TIMER(group, timer).conf.low_speed_update = 1;//This bit is only useful for low speed timer channels, reserved for high speed timers -#if CONFIG_IDF_TARGET_ESP32 - } -#endif - LEDC_TIMER(group, timer).conf.pause = 0; - LEDC_TIMER(group, timer).conf.rst = 1;//This bit is used to reset timer the counter will be 0 after reset. - LEDC_TIMER(group, timer).conf.rst = 0; - LEDC_MUTEX_UNLOCK(); - _activeChannels |= (1 << chan); // mark as active for APB callback -} - -//max div_num 0x3FFFF (262143) -//max bit_num 0x1F (31) -static double _ledcSetupTimerFreq(uint8_t chan, double freq, uint8_t bit_num) +double ledcSetup(uint8_t chan, double freq, uint8_t bit_num) { - uint64_t clk_freq = getApbFrequency(); - clk_freq <<= 8;//div_num is 8 bit decimal - uint32_t div_num = (clk_freq >> bit_num) / freq; - bool apb_clk = true; - if(div_num > LEDC_DIV_NUM_HSTIMER0_V) { - clk_freq /= 80; - div_num = (clk_freq >> bit_num) / freq; - if(div_num > LEDC_DIV_NUM_HSTIMER0_V) { - div_num = LEDC_DIV_NUM_HSTIMER0_V;//lowest clock possible - } - apb_clk = false; - } else if(div_num < 256) { - div_num = 256;//highest clock possible + if(chan >= LEDC_CHANNELS){ + log_e("No more LEDC channels available! You can have maximum %u", LEDC_CHANNELS); + return 0; } - _ledcSetupTimer(chan, div_num, bit_num, apb_clk); - //log_i("Fin: %f, Fclk: %uMhz, bits: %u, DIV: %u, Fout: %f", - // freq, apb_clk?80:1, bit_num, div_num, (clk_freq >> bit_num) / (double)div_num); - return (clk_freq >> bit_num) / (double)div_num; -} - -static double _ledcTimerRead(uint8_t chan) -{ - uint32_t div_num; - uint8_t bit_num; - bool apb_clk; uint8_t group=(chan/8), timer=((chan/2)%4); - LEDC_MUTEX_LOCK(); - div_num = LEDC_TIMER(group, timer).conf.clock_divider;//18 bit (10.8) This register is used to configure parameter for divider in timer the least significant eight bits represent the decimal part. - bit_num = LEDC_TIMER(group, timer).conf.duty_resolution;//5 bit This register controls the range of the counter in timer. the counter range is [0 2**bit_num] the max bit width for counter is 20. - apb_clk = LEDC_TIMER(group, timer).conf.tick_sel;//apb clock - LEDC_MUTEX_UNLOCK(); - uint64_t clk_freq = 1000000; - if(apb_clk) { - clk_freq = getApbFrequency(); - } - clk_freq <<= 8;//div_num is 8 bit decimal - return (clk_freq >> bit_num) / (double)div_num; -} -static void _ledcSetupChannel(uint8_t chan, uint8_t idle_level) -{ - uint8_t group=(chan/8), channel=(chan%8), timer=((chan/2)%4); - LEDC_MUTEX_LOCK(); - LEDC_CHAN(group, channel).conf0.timer_sel = timer;//2 bit Selects the timer to attach 0-3 - LEDC_CHAN(group, channel).conf0.idle_lv = idle_level;//1 bit This bit is used to control the output value when channel is off. - LEDC_CHAN(group, channel).hpoint.hpoint = 0;//20 bit The output value changes to high when timer selected by channel has reached hpoint - LEDC_CHAN(group, channel).conf1.duty_inc = 1;//1 bit This register is used to increase the duty of output signal or decrease the duty of output signal for high speed channel - LEDC_CHAN(group, channel).conf1.duty_num = 1;//10 bit This register is used to control the number of increased or decreased times for channel - LEDC_CHAN(group, channel).conf1.duty_cycle = 1;//10 bit This register is used to increase or decrease the duty every duty_cycle cycles for channel - LEDC_CHAN(group, channel).conf1.duty_scale = 0;//10 bit This register controls the increase or decrease step scale for channel. - LEDC_CHAN(group, channel).duty.duty = 0; - LEDC_CHAN(group, channel).conf0.sig_out_en = 0;//This is the output enable control bit for channel - LEDC_CHAN(group, channel).conf1.duty_start = 0;//When duty_num duty_cycle and duty_scale has been configured. these register won't take effect until set duty_start. this bit is automatically cleared by hardware. -#if CONFIG_IDF_TARGET_ESP32 - if(group) { -#endif - LEDC_CHAN(group, channel).conf0.low_speed_update = 1; -#if CONFIG_IDF_TARGET_ESP32 - } else { - LEDC_CHAN(group, channel).conf0.clk_en = 0; - } -#endif - LEDC_MUTEX_UNLOCK(); -} + ledc_timer_config_t ledc_timer = { + .speed_mode = group, + .timer_num = timer, + .duty_resolution = bit_num, + .freq_hz = freq, + .clk_cfg = LEDC_DEFAULT_CLK + }; + ledc_timer_config(&ledc_timer); + channels_resolution[chan] = bit_num; -double ledcSetup(uint8_t chan, double freq, uint8_t bit_num) -{ - if(chan > LAST_CHAN) { - return 0; - } - double res_freq = _ledcSetupTimerFreq(chan, freq, bit_num); - _ledcSetupChannel(chan, LOW); - return res_freq; + return ledc_get_freq(group,timer); } void ledcWrite(uint8_t chan, uint32_t duty) { - if(chan > LAST_CHAN) { + if(chan >= LEDC_CHANNELS){ return; } uint8_t group=(chan/8), channel=(chan%8); - LEDC_MUTEX_LOCK(); - LEDC_CHAN(group, channel).duty.duty = duty << 4;//25 bit (21.4) - if(duty) { - LEDC_CHAN(group, channel).conf0.sig_out_en = 1;//This is the output enable control bit for channel - LEDC_CHAN(group, channel).conf1.duty_start = 1;//When duty_num duty_cycle and duty_scale has been configured. these register won't take effect until set duty_start. this bit is automatically cleared by hardware. -#if CONFIG_IDF_TARGET_ESP32 - if(group) { -#endif - LEDC_CHAN(group, channel).conf0.low_speed_update = 1; -#if CONFIG_IDF_TARGET_ESP32 - } else { - LEDC_CHAN(group, channel).conf0.clk_en = 1; - } -#endif - } else { - LEDC_CHAN(group, channel).conf0.sig_out_en = 0;//This is the output enable control bit for channel - LEDC_CHAN(group, channel).conf1.duty_start = 0;//When duty_num duty_cycle and duty_scale has been configured. these register won't take effect until set duty_start. this bit is automatically cleared by hardware. -#if CONFIG_IDF_TARGET_ESP32 - if(group) { -#endif - LEDC_CHAN(group, channel).conf0.low_speed_update = 1; -#if CONFIG_IDF_TARGET_ESP32 - } else { - LEDC_CHAN(group, channel).conf0.clk_en = 0; - } -#endif + + //Fixing if all bits in resolution is set = LEDC FULL ON + uint32_t max_duty = (1 << channels_resolution[chan]) - 1; + + if(duty == max_duty){ + duty = max_duty + 1; } - LEDC_MUTEX_UNLOCK(); + + ledc_set_duty(group, channel, duty); + ledc_update_duty(group, channel); } uint32_t ledcRead(uint8_t chan) { - if(chan > LAST_CHAN) { + if(chan >= LEDC_CHANNELS){ return 0; } - return LEDC.channel_group[chan/8].channel[chan%8].duty.duty >> 4; + uint8_t group=(chan/8), channel=(chan%8); + return ledc_get_duty(group,channel); } double ledcReadFreq(uint8_t chan) @@ -276,19 +107,33 @@ double ledcReadFreq(uint8_t chan) if(!ledcRead(chan)){ return 0; } - return _ledcTimerRead(chan); + uint8_t group=(chan/8), timer=((chan/2)%4); + return ledc_get_freq(group,timer); } double ledcWriteTone(uint8_t chan, double freq) { - if(chan > LAST_CHAN) { + if(chan >= LEDC_CHANNELS){ return 0; } - if(!freq) { + if(!freq){ ledcWrite(chan, 0); return 0; } - double res_freq = _ledcSetupTimerFreq(chan, freq, 10); + + uint8_t group=(chan/8), timer=((chan/2)%4); + + ledc_timer_config_t ledc_timer = { + .speed_mode = group, + .timer_num = timer, + .duty_resolution = 10, + .freq_hz = freq, + .clk_cfg = LEDC_DEFAULT_CLK + }; + ledc_timer_config(&ledc_timer); + channels_resolution[chan] = 10; + + double res_freq = ledc_get_freq(group,timer); ledcWrite(chan, 0x1FF); return res_freq; } @@ -308,15 +153,21 @@ double ledcWriteNote(uint8_t chan, note_t note, uint8_t octave){ void ledcAttachPin(uint8_t pin, uint8_t chan) { - if(chan > LAST_CHAN) { + if(chan >= LEDC_CHANNELS){ return; } - pinMode(pin, OUTPUT); -#if CONFIG_IDF_TARGET_ESP32S2 || CONFIG_IDF_TARGET_ESP32C3 - pinMatrixOutAttach(pin, LEDC_LS_SIG_OUT0_IDX + chan, false, false); -#else - pinMatrixOutAttach(pin, ((chan/8)?LEDC_LS_SIG_OUT0_IDX:LEDC_HS_SIG_OUT0_IDX) + (chan%8), false, false); -#endif + uint8_t group=(chan/8), channel=(chan%8), timer=((chan/2)%4); + + ledc_channel_config_t ledc_channel = { + .speed_mode = group, + .channel = channel, + .timer_sel = timer, + .intr_type = LEDC_INTR_DISABLE, + .gpio_num = pin, + .duty = 0, + .hpoint = 0 + }; + ledc_channel_config(&ledc_channel); } void ledcDetachPin(uint8_t pin) @@ -326,21 +177,32 @@ void ledcDetachPin(uint8_t pin) double ledcChangeFrequency(uint8_t chan, double freq, uint8_t bit_num) { - if (chan > 15) { + if(chan >= LEDC_CHANNELS){ return 0; } - double res_freq = _ledcSetupTimerFreq(chan, freq, bit_num); - return res_freq; + uint8_t group=(chan/8), timer=((chan/2)%4); + + ledc_timer_config_t ledc_timer = { + .speed_mode = group, + .timer_num = timer, + .duty_resolution = bit_num, + .freq_hz = freq, + .clk_cfg = LEDC_DEFAULT_CLK + }; + ledc_timer_config(&ledc_timer); + channels_resolution[chan] = bit_num; + + return ledc_get_freq(group,timer); } static int8_t pin_to_channel[SOC_GPIO_PIN_COUNT] = { 0 }; -static int cnt_channel = SOC_LEDC_CHANNEL_NUM; +static int cnt_channel = LEDC_CHANNELS; void analogWrite(uint8_t pin, int value) { // Use ledc hardware for internal pins if (pin < SOC_GPIO_PIN_COUNT) { if (pin_to_channel[pin] == 0) { if (!cnt_channel) { - log_e("No more analogWrite channels available! You can have maximum %u", SOC_LEDC_CHANNEL_NUM); + log_e("No more analogWrite channels available! You can have maximum %u", LEDC_CHANNELS); return; } pin_to_channel[pin] = cnt_channel--; diff --git a/cores/esp32/esp32-hal-rmt.c b/cores/esp32/esp32-hal-rmt.c index a72d113d7b8..9c619eea2c8 100644 --- a/cores/esp32/esp32-hal-rmt.c +++ b/cores/esp32/esp32-hal-rmt.c @@ -12,53 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "freertos/FreeRTOS.h" -#include "freertos/event_groups.h" -#include "freertos/semphr.h" - #include "esp32-hal.h" -#include "esp8266-compat.h" -#include "soc/gpio_reg.h" -#include "soc/rmt_struct.h" -#include "driver/periph_ctrl.h" -#include "esp_intr_alloc.h" +#include "driver/rmt.h" /** * Internal macros */ -#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 -#define MAX_CHANNELS 8 -#define MAX_DATA_PER_CHANNEL 64 -#define MAX_DATA_PER_ITTERATION 62 -#elif CONFIG_IDF_TARGET_ESP32S2 -#define MAX_CHANNELS 4 -#define MAX_DATA_PER_CHANNEL 64 -#define MAX_DATA_PER_ITTERATION 62 -#elif CONFIG_IDF_TARGET_ESP32C3 -#define MAX_CHANNELS 4 -#define MAX_DATA_PER_CHANNEL 48 -#define MAX_DATA_PER_ITTERATION 46 -#else -#error Target CONFIG_IDF_TARGET is not supported -#endif -#define _ABS(a) (a>0?a:-a) + +#define MAX_CHANNELS (SOC_RMT_GROUPS * SOC_RMT_CHANNELS_PER_GROUP) + +#define RMT_TX_CH_START (0) +#define RMT_TX_CH_END (SOC_RMT_TX_CANDIDATES_PER_GROUP - 1) +#define RMT_RX_CH_START (SOC_RMT_CHANNELS_PER_GROUP - SOC_RMT_TX_CANDIDATES_PER_GROUP) +#define RMT_RX_CH_END (SOC_RMT_CHANNELS_PER_GROUP - 1) + #define _LIMIT(a,b) (a>b?b:a) -#if CONFIG_IDF_TARGET_ESP32C3 -#define _INT_TX_END(channel) (1<<(channel)) -#define _INT_RX_END(channel) (4<<(channel)) -#define _INT_ERROR(channel) (16<<(channel)) -#define _INT_THR_EVNT(channel) (256<<(channel)) -#else -#define __INT_TX_END (1) -#define __INT_RX_END (2) -#define __INT_ERROR (4) -#define __INT_THR_EVNT (1<<24) - -#define _INT_TX_END(channel) (__INT_TX_END<<(channel*3)) -#define _INT_RX_END(channel) (__INT_RX_END<<(channel*3)) -#define _INT_ERROR(channel) (__INT_ERROR<<(channel*3)) -#define _INT_THR_EVNT(channel) ((__INT_THR_EVNT)<<(channel)) -#endif #if CONFIG_DISABLE_HAL_LOCKS # define RMT_MUTEX_LOCK(channel) @@ -77,39 +45,57 @@ # define DEBUG_INTERRUPT_END(pin) #endif /* _RMT_INTERNAL_DEBUG */ +#define RMT_DEFAULT_ARD_CONFIG_TX(gpio, channel_id, buffers) \ + { \ + .rmt_mode = RMT_MODE_TX, \ + .channel = channel_id, \ + .gpio_num = gpio, \ + .clk_div = 1, \ + .mem_block_num = buffers, \ + .flags = 0, \ + .tx_config = { \ + .carrier_level = RMT_CARRIER_LEVEL_HIGH, \ + .idle_level = RMT_IDLE_LEVEL_LOW, \ + .carrier_duty_percent = 50, \ + .carrier_en = false, \ + .loop_en = false, \ + .idle_output_en = true, \ + } \ + } + +#define RMT_DEFAULT_ARD_CONFIG_RX(gpio, channel_id, buffers) \ + { \ + .rmt_mode = RMT_MODE_RX, \ + .channel = channel_id, \ + .gpio_num = gpio, \ + .clk_div = 1, \ + .mem_block_num = buffers, \ + .flags = 0, \ + .rx_config = { \ + .idle_threshold = 0x80, \ + .filter_ticks_thresh = 100, \ + .filter_en = false, \ + } \ + } + + + + /** * Typedefs for internal stuctures, enums */ -typedef enum { - E_NO_INTR = 0, - E_TX_INTR = 1, - E_TXTHR_INTR = 2, - E_RX_INTR = 4, -} intr_mode_t; - -typedef enum { - E_INACTIVE = 0, - E_FIRST_HALF = 1, - E_LAST_DATA = 2, - E_END_TRANS = 4, - E_SET_CONTI = 8, -} transaction_state_t; - struct rmt_obj_s { bool allocated; EventGroupHandle_t events; - int pin; int channel; - bool tx_not_rx; int buffers; int data_size; uint32_t* data_ptr; - intr_mode_t intr_mode; - transaction_state_t tx_state; rmt_rx_data_cb_t cb; - bool data_alloc; void * arg; + TaskHandle_t rxTaskHandle; + bool rx_completed; }; /** @@ -117,56 +103,156 @@ struct rmt_obj_s */ static xSemaphoreHandle g_rmt_objlocks[MAX_CHANNELS] = { NULL, NULL, NULL, NULL, -#if CONFIG_IDF_TARGET_ESP32 +#if MAX_CHANNELS > 4 NULL, NULL, NULL, NULL #endif }; static rmt_obj_t g_rmt_objects[MAX_CHANNELS] = { - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false, NULL}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false, NULL}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false, NULL}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false, NULL}, -#if CONFIG_IDF_TARGET_ESP32 - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false, NULL}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false, NULL}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false, NULL}, - { false, NULL, 0, 0, 0, 0, 0, NULL, E_NO_INTR, E_INACTIVE, NULL, false, NULL}, + { false, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, true}, + { false, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, true}, + { false, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, true}, + { false, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, true}, +#if MAX_CHANNELS > 4 + { false, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, true}, + { false, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, true}, + { false, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, true}, + { false, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, true}, #endif }; /** * Internal variables for driver data */ -static intr_handle_t intr_handle; - -static bool periph_enabled = false; - static xSemaphoreHandle g_rmt_block_lock = NULL; /** * Internal method (private) declarations */ -static void _initPin(int pin, int channel, bool tx_not_rx); -static bool _rmtSendOnce(rmt_obj_t* rmt, rmt_data_t* data, size_t size, bool continuous); +static rmt_obj_t* _rmtAllocate(int pin, int from, int size) +{ + size_t i; + // setup how many buffers shall we use + g_rmt_objects[from].buffers = size; + + for (i=0; ichannel; + +RMT_MUTEX_LOCK(channel); + rmt_get_tx_loop_mode(channel, &loop_en); + rmt_get_clk_div(channel, &div_cnt); + rmt_get_mem_block_num(channel, &memNum); + rmt_get_mem_pd(channel, &lowPowerMode); + rmt_get_memory_owner(channel, &owner); + rmt_get_rx_idle_thresh(channel, &idleThreshold); + rmt_get_status(channel, &status); + rmt_get_source_clk(channel, &srcClk); + + log_d("Status for RMT channel %d", channel); + log_d("- Loop enabled: %d", loop_en); + log_d("- Clock divisor: %d", div_cnt); + log_d("- Number of memory blocks: %d", memNum); + log_d("- Low power mode: %d", lowPowerMode); + log_d("- Memory owner: %s", owner==RMT_MEM_OWNER_TX?"TX":"RX"); + log_d("- Idle threshold: %d", idleThreshold); + log_d("- Status: %d", status); + log_d("- Source clock: %s", srcClk==RMT_BASECLK_APB?"APB (80MHz)":"1MHz"); +RMT_MUTEX_UNLOCK(channel); +} + +static void _rmtRxTask(void *args) { + rmt_obj_t *rmt = (rmt_obj_t *) args; + RingbufHandle_t rb = NULL; + size_t rmt_len = 0; + rmt_item32_t *data = NULL; -static void ARDUINO_ISR_ATTR _rmt_isr(void* arg); + if (!rmt) { + log_e(" -- Inavalid Argument"); + goto err; + } + + int channel = rmt->channel; + rmt_get_ringbuf_handle(channel, &rb); + if (!rb) { + log_e(" -- Failed to get RMT ringbuffer handle"); + goto err; + } + + for(;;) { + data = (rmt_item32_t *) xRingbufferReceive(rb, &rmt_len, portMAX_DELAY); + if (data) { + log_d(" -- Got %d bytes on RX Ringbuffer - CH %d", rmt_len, rmt->channel); + rmt->rx_completed = true; // used in rmtReceiveCompleted() + // callback + if (rmt->cb) { + (rmt->cb)((uint32_t *)data, rmt_len / sizeof(rmt_item32_t), rmt->arg); + } else { + // stop RX -- will force a correct call with a callback pointer / new rmtReadData() / rmtReadAsync() + rmt_rx_stop(channel); + } + // Async Read -- copy data to caller + if (rmt->data_ptr && rmt->data_size) { + uint32_t data_size = rmt->data_size; + uint32_t read_len = rmt_len / sizeof(rmt_item32_t); + if (read_len < rmt->data_size) data_size = read_len; + rmt_item32_t *p = (rmt_item32_t *)rmt->data_ptr; + for (uint32_t i = 0; i < data_size; i++) { + p[i] = data[i]; + } + } + // set events + if (rmt->events) { + xEventGroupSetBits(rmt->events, RMT_FLAG_RX_DONE); + } + vRingbufferReturnItem(rb, (void *) data); + } // xRingbufferReceive + } // for(;;) -static rmt_obj_t* _rmtAllocate(int pin, int from, int size); +err: + vTaskDelete(NULL); +} -static void _initPin(int pin, int channel, bool tx_not_rx); -static int ARDUINO_ISR_ATTR _rmt_get_mem_len(uint8_t channel); +static bool _rmtCreateRxTask(rmt_obj_t* rmt) +{ + if (!rmt) { + return false; + } + if (rmt->rxTaskHandle) { // Task already created + return false; + } -static void ARDUINO_ISR_ATTR _rmt_tx_mem_first(uint8_t ch); + xTaskCreate(_rmtRxTask, "rmt_rx_task", 4096, rmt, 20, &rmt->rxTaskHandle); -static void ARDUINO_ISR_ATTR _rmt_tx_mem_second(uint8_t ch); + if(rmt->rxTaskHandle == NULL){ + log_e("RMT RX Task create failed"); + return false; + } + return true; +} /** * Public method definitions */ + bool rmtSetCarrier(rmt_obj_t* rmt, bool carrier_en, bool carrier_level, uint32_t low, uint32_t high) { if (!rmt || low > 0xFFFF || high > 0xFFFF) { @@ -175,21 +261,9 @@ bool rmtSetCarrier(rmt_obj_t* rmt, bool carrier_en, bool carrier_level, uint32_t size_t channel = rmt->channel; RMT_MUTEX_LOCK(channel); -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_carrier[channel].low = low; - RMT.tx_carrier[channel].high = high; - RMT.rx_conf[channel].conf0.carrier_en = carrier_en; - RMT.rx_conf[channel].conf0.carrier_out_lv = carrier_level; -#else - RMT.carrier_duty_ch[channel].low = low; - RMT.carrier_duty_ch[channel].high = high; - RMT.conf_ch[channel].conf0.carrier_en = carrier_en; - RMT.conf_ch[channel].conf0.carrier_out_lv = carrier_level; -#endif + rmt_set_tx_carrier(channel, carrier_en, high, low, carrier_level); RMT_MUTEX_UNLOCK(channel); - return true; - } bool rmtSetFilter(rmt_obj_t* rmt, bool filter_en, uint32_t filter_level) @@ -200,19 +274,9 @@ bool rmtSetFilter(rmt_obj_t* rmt, bool filter_en, uint32_t filter_level) size_t channel = rmt->channel; RMT_MUTEX_LOCK(channel); - -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.rx_conf[channel].conf1.rx_filter_thres = filter_level; - RMT.rx_conf[channel].conf1.rx_filter_en = filter_en; -#else - RMT.conf_ch[channel].conf1.rx_filter_thres = filter_level; - RMT.conf_ch[channel].conf1.rx_filter_en = filter_en; -#endif - + rmt_set_rx_filter(channel, filter_en, filter_level); RMT_MUTEX_UNLOCK(channel); - return true; - } bool rmtSetRxThreshold(rmt_obj_t* rmt, uint32_t value) @@ -223,13 +287,8 @@ bool rmtSetRxThreshold(rmt_obj_t* rmt, uint32_t value) size_t channel = rmt->channel; RMT_MUTEX_LOCK(channel); -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.rx_conf[channel].conf0.idle_thres = value; -#else - RMT.conf_ch[channel].conf0.idle_thres = value; -#endif + rmt_set_rx_idle_thresh(channel, value); RMT_MUTEX_UNLOCK(channel); - return true; } @@ -245,26 +304,34 @@ bool rmtDeinit(rmt_obj_t *rmt) return false; } + RMT_MUTEX_LOCK(rmt->channel); + // force stopping rmt processing + rmt_rx_stop(rmt->channel); + rmt_tx_stop(rmt->channel); + + if(rmt->rxTaskHandle){ + vTaskDelete(rmt->rxTaskHandle); + rmt->rxTaskHandle = NULL; + } + rmt_driver_uninstall(rmt->channel); + size_t from = rmt->channel; size_t to = rmt->buffers + rmt->channel; size_t i; -#if !CONFIG_DISABLE_HAL_LOCKS - if(g_rmt_objlocks[from] != NULL) { - vSemaphoreDelete(g_rmt_objlocks[from]); - } -#endif - - if (g_rmt_objects[from].data_alloc) { - free(g_rmt_objects[from].data_ptr); - } - for (i = from; i < to; i++) { g_rmt_objects[i].allocated = false; } g_rmt_objects[from].channel = 0; g_rmt_objects[from].buffers = 0; + RMT_MUTEX_UNLOCK(rmt->channel); + +#if !CONFIG_DISABLE_HAL_LOCKS + if(g_rmt_objlocks[from] != NULL) { + vSemaphoreDelete(g_rmt_objlocks[from]); + } +#endif return true; } @@ -275,12 +342,13 @@ bool rmtLoop(rmt_obj_t* rmt, rmt_data_t* data, size_t size) return false; } - int allocated_size = MAX_DATA_PER_CHANNEL * rmt->buffers; - - if (size > allocated_size) { - return false; - } - return _rmtSendOnce(rmt, data, size, true); + int channel = rmt->channel; + RMT_MUTEX_LOCK(channel); + rmt_tx_stop(channel); + rmt_set_tx_loop_mode(channel, true); + rmt_write_items(channel, (const rmt_item32_t *)data, size, false); + RMT_MUTEX_UNLOCK(channel); + return true; } bool rmtWrite(rmt_obj_t* rmt, rmt_data_t* data, size_t size) @@ -290,84 +358,36 @@ bool rmtWrite(rmt_obj_t* rmt, rmt_data_t* data, size_t size) } int channel = rmt->channel; - int allocated_size = MAX_DATA_PER_CHANNEL * rmt->buffers; - - if (size > (allocated_size - 1)) { - - int half_tx_nr = MAX_DATA_PER_ITTERATION/2; - RMT_MUTEX_LOCK(channel); - // setup interrupt handler if not yet installed for half and full tx - if (!intr_handle) { - esp_intr_alloc(ETS_RMT_INTR_SOURCE, (int)ARDUINO_ISR_FLAG, _rmt_isr, NULL, &intr_handle); - } - - rmt->data_size = size - MAX_DATA_PER_ITTERATION; - rmt->data_ptr = ((uint32_t*)data) + MAX_DATA_PER_ITTERATION; - rmt->intr_mode = E_TX_INTR | E_TXTHR_INTR; - rmt->tx_state = E_SET_CONTI | E_FIRST_HALF; - -#if CONFIG_IDF_TARGET_ESP32C3 - //uint32_t val = RMT.tx_conf[channel].val; - // init the tx limit for interruption - RMT.tx_lim[channel].limit = half_tx_nr+2; - //RMT.tx_conf[channel].val = val; - //RMT.tx_conf[channel].conf_update = 1; - // reset memory pointer - RMT.tx_conf[channel].mem_rst = 1; - //RMT.tx_conf[channel].mem_rst = 0; - RMT.tx_conf[channel].mem_rd_rst = 1; - //RMT.tx_conf[channel].mem_rd_rst = 0; -#else - // init the tx limit for interruption - RMT.tx_lim_ch[channel].limit = half_tx_nr+2; - // reset memory pointer - RMT.conf_ch[channel].conf1.apb_mem_rst = 1; - RMT.conf_ch[channel].conf1.apb_mem_rst = 0; - RMT.conf_ch[channel].conf1.mem_rd_rst = 1; - RMT.conf_ch[channel].conf1.mem_rd_rst = 0; - RMT.conf_ch[channel].conf1.mem_wr_rst = 1; - RMT.conf_ch[channel].conf1.mem_wr_rst = 0; -#endif - // set the tx end mark - //RMTMEM.chan[channel].data32[MAX_DATA_PER_ITTERATION].val = 0; - - // clear and enable both Tx completed and half tx event - RMT.int_clr.val = _INT_TX_END(channel); - RMT.int_clr.val = _INT_THR_EVNT(channel); - RMT.int_clr.val = _INT_ERROR(channel); - - RMT.int_ena.val |= _INT_TX_END(channel); - RMT.int_ena.val |= _INT_THR_EVNT(channel); - RMT.int_ena.val |= _INT_ERROR(channel); - - RMT_MUTEX_UNLOCK(channel); - - // start the transation - //return _rmtSendOnce(rmt, data, MAX_DATA_PER_ITTERATION, true); - return _rmtSendOnce(rmt, data, MAX_DATA_PER_ITTERATION, false); - } else { - // use one-go mode if data fits one buffer - return _rmtSendOnce(rmt, data, size, false); - } + RMT_MUTEX_LOCK(channel); + rmt_tx_stop(channel); + rmt_set_tx_loop_mode(channel, false); + rmt_write_items(channel, (const rmt_item32_t *)data, size, false); + RMT_MUTEX_UNLOCK(channel); + return true; } -bool rmtReadData(rmt_obj_t* rmt, uint32_t* data, size_t size) +bool rmtWriteBlocking(rmt_obj_t* rmt, rmt_data_t* data, size_t size) { if (!rmt) { return false; } + int channel = rmt->channel; + RMT_MUTEX_LOCK(channel); + rmt_tx_stop(channel); + rmt_set_tx_loop_mode(channel, false); + rmt_write_items(channel, (const rmt_item32_t *)data, size, true); + RMT_MUTEX_UNLOCK(channel); + return true; +} - if (g_rmt_objects[channel].buffers < size/MAX_DATA_PER_CHANNEL) { +bool rmtReadData(rmt_obj_t* rmt, uint32_t* data, size_t size) +{ + if (!rmt) { return false; } - size_t i; - volatile uint32_t* rmt_mem_ptr = &(RMTMEM.chan[channel].data32[0].val); - for (i=0; ichannel; - RMT.int_clr.val = _INT_ERROR(channel); - RMT.int_ena.val |= _INT_ERROR(channel); - -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.rx_conf[channel].conf1.mem_owner = 1; - RMT.rx_conf[channel].conf1.mem_wr_rst = 1; - RMT.rx_conf[channel].conf1.rx_en = 1; -#else - RMT.conf_ch[channel].conf1.mem_owner = 1; - RMT.conf_ch[channel].conf1.mem_wr_rst = 1; - RMT.conf_ch[channel].conf1.rx_en = 1; -#endif + RMT_MUTEX_LOCK(channel); + rmt_set_memory_owner(channel, RMT_MEM_OWNER_RX); + rmt_rx_start(channel, true); + rmt->rx_completed = false; + RMT_MUTEX_UNLOCK(channel); return true; } @@ -399,75 +412,46 @@ bool rmtReceiveCompleted(rmt_obj_t* rmt) if (!rmt) { return false; } - int channel = rmt->channel; - if (RMT.int_raw.val&_INT_RX_END(channel)) { - // RX end flag - RMT.int_clr.val = _INT_RX_END(channel); - return true; - } else { - return false; - } + return rmt->rx_completed; } bool rmtRead(rmt_obj_t* rmt, rmt_rx_data_cb_t cb, void * arg) { - if (!rmt && !cb) { + if (!rmt || !cb) { return false; } int channel = rmt->channel; - RMT_MUTEX_LOCK(channel); rmt->arg = arg; - rmt->intr_mode = E_RX_INTR; - rmt->tx_state = E_FIRST_HALF; rmt->cb = cb; - // allocate internally two buffers which would alternate - if (!rmt->data_alloc) { - rmt->data_ptr = (uint32_t*)malloc(2*MAX_DATA_PER_CHANNEL*(rmt->buffers)*sizeof(uint32_t)); - rmt->data_size = MAX_DATA_PER_CHANNEL*rmt->buffers; - rmt->data_alloc = true; - } - -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.rx_conf[channel].conf1.mem_owner = 1; -#else - RMT.conf_ch[channel].conf1.mem_owner = 1; -#endif - RMT.int_clr.val = _INT_RX_END(channel); - RMT.int_clr.val = _INT_ERROR(channel); - - RMT.int_ena.val |= _INT_RX_END(channel); - RMT.int_ena.val |= _INT_ERROR(channel); -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.rx_conf[channel].conf1.mem_wr_rst = 1; - - RMT.rx_conf[channel].conf1.rx_en = 1; -#else - RMT.conf_ch[channel].conf1.mem_wr_rst = 1; - - RMT.conf_ch[channel].conf1.rx_en = 1; -#endif + RMT_MUTEX_LOCK(channel); + // cb as NULL is a way to cancel the callback process + if (cb == NULL) { + rmt_rx_stop(channel); + return true; + } + // Start a read process but now with a call back function + rmt_set_memory_owner(channel, RMT_MEM_OWNER_RX); + rmt_rx_start(channel, true); + rmt->rx_completed = false; + _rmtCreateRxTask(rmt); RMT_MUTEX_UNLOCK(channel); - return true; } -bool rmtEnd(rmt_obj_t* rmt) { +bool rmtEnd(rmt_obj_t* rmt) +{ if (!rmt) { return false; } int channel = rmt->channel; RMT_MUTEX_LOCK(channel); -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.rx_conf[channel].conf1.rx_en = 1; -#else - RMT.conf_ch[channel].conf1.rx_en = 1; -#endif + rmt_rx_stop(channel); + rmt->rx_completed = true; RMT_MUTEX_UNLOCK(channel); - return true; } @@ -478,55 +462,34 @@ bool rmtReadAsync(rmt_obj_t* rmt, rmt_data_t* data, size_t size, void* eventFlag } int channel = rmt->channel; - if (g_rmt_objects[channel].buffers < size/MAX_DATA_PER_CHANNEL) { - return false; - } + // No limit on size with IDF ;-) + //if (g_rmt_objects[channel].buffers < size/SOC_RMT_MEM_WORDS_PER_CHANNEL) { + // return false; + //} + RMT_MUTEX_LOCK(channel); if (eventFlag) { xEventGroupClearBits(eventFlag, RMT_FLAGS_ALL); - rmt->events = eventFlag; } - - if (data && size>0) { - rmt->data_ptr = (uint32_t*)data; - rmt->data_size = size; - } - - RMT_MUTEX_LOCK(channel); - rmt->intr_mode = E_RX_INTR; - -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.rx_conf[channel].conf1.mem_owner = 1; -#else - RMT.conf_ch[channel].conf1.mem_owner = 1; -#endif - - RMT.int_clr.val = _INT_RX_END(channel); - RMT.int_clr.val = _INT_ERROR(channel); - - RMT.int_ena.val |= _INT_RX_END(channel); - RMT.int_ena.val |= _INT_ERROR(channel); - -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.rx_conf[channel].conf1.mem_wr_rst = 1; - - RMT.rx_conf[channel].conf1.rx_en = 1; -#else - RMT.conf_ch[channel].conf1.mem_wr_rst = 1; - - RMT.conf_ch[channel].conf1.rx_en = 1; -#endif + // if NULL, no problems - rmtReadAsync works as a plain rmtReadData() + rmt->events = eventFlag; + + // if NULL, no problems - task will take care of it + rmt->data_ptr = (uint32_t*)data; + rmt->data_size = size; + + // Start a read process + rmt_set_memory_owner(channel, RMT_MEM_OWNER_RX); + rmt_rx_start(channel, true); + rmt->rx_completed = false; + _rmtCreateRxTask(rmt); RMT_MUTEX_UNLOCK(channel); // wait for data if requested so if (waitForData && eventFlag) { - uint32_t flags = xEventGroupWaitBits(eventFlag, RMT_FLAGS_ALL, + xEventGroupWaitBits(eventFlag, RMT_FLAGS_ALL, pdTRUE /* clear on exit */, pdFALSE /* wait for all bits */, timeout); - if (flags & RMT_FLAG_ERROR) { - return false; - } } - return true; } @@ -534,46 +497,27 @@ float rmtSetTick(rmt_obj_t* rmt, float tick) { if (!rmt) { return false; - } - /* - divider field span from 1 (smallest), 2, 3, ... , 0xFF, 0x00 (highest) - * rmt tick from 1/80M -> 12.5ns (1x) div_cnt = 0x01 - 3.2 us (256x) div_cnt = 0x00 - * rmt tick for 1 MHz -> 1us (1x) div_cnt = 0x01 - 256us (256x) div_cnt = 0x00 - */ - + } size_t channel = rmt->channel; -#if CONFIG_IDF_TARGET_ESP32C3 - int apb_div = _LIMIT(tick/25.0f, 256); - float apb_tick = 25.0f * apb_div; - RMT.tx_conf[channel].div_cnt = apb_div & 0xFF; - RMT.tx_conf[channel].conf_update = 1; - return apb_tick; -#else + RMT_MUTEX_LOCK(channel); + // RMT_BASECLK_REF (1MHz) is not supported in IDF upon Programmming Guide + // Only APB works + rmt_set_source_clk(channel, RMT_BASECLK_APB); int apb_div = _LIMIT(tick/12.5f, 256); - int ref_div = _LIMIT(tick/1000, 256); float apb_tick = 12.5f * apb_div; - float ref_tick = 1000.0f * ref_div; - if (_ABS(apb_tick - tick) < _ABS(ref_tick - tick)) { - RMT.conf_ch[channel].conf0.div_cnt = apb_div & 0xFF; - RMT.conf_ch[channel].conf1.ref_always_on = 1; - return apb_tick; - } else { - RMT.conf_ch[channel].conf0.div_cnt = ref_div & 0xFF; - RMT.conf_ch[channel].conf1.ref_always_on = 0; - return ref_tick; - } -#endif + + rmt_set_clk_div(channel, apb_div & 0xFF); + RMT_MUTEX_UNLOCK(channel); + return apb_tick; } rmt_obj_t* rmtInit(int pin, bool tx_not_rx, rmt_reserve_memsize_t memsize) { int buffers = memsize; - rmt_obj_t* rmt; - size_t i; - size_t j; + rmt_obj_t* rmt = NULL; + size_t i = 0; + size_t j = 0; // create common block mutex for protecting allocs from multiple threads if (!g_rmt_block_lock) { @@ -582,8 +526,17 @@ rmt_obj_t* rmtInit(int pin, bool tx_not_rx, rmt_reserve_memsize_t memsize) // lock while (xSemaphoreTake(g_rmt_block_lock, portMAX_DELAY) != pdPASS) {} - for (i=0; i MAX_CHANNELS || j != buffers) { xSemaphoreGive(g_rmt_block_lock); + log_e("rmInit Failed - not enough channels"); return NULL; } + + // A suitable channel has been found, it has to block its resources in our internal data strucuture + size_t channel = i; rmt = _rmtAllocate(pin, i, buffers); xSemaphoreGive(g_rmt_block_lock); - size_t channel = i; + rmt->buffers = buffers; + rmt->channel = channel; + rmt->arg = NULL; + rmt->cb = NULL; + rmt->data_ptr = NULL; + rmt->data_size = 0; + rmt->rx_completed = false; + rmt->events = NULL; #if !CONFIG_DISABLE_HAL_LOCKS if(g_rmt_objlocks[channel] == NULL) { @@ -615,447 +579,30 @@ rmt_obj_t* rmtInit(int pin, bool tx_not_rx, rmt_reserve_memsize_t memsize) #endif RMT_MUTEX_LOCK(channel); - - rmt->pin = pin; - rmt->tx_not_rx = tx_not_rx; - rmt->buffers =buffers; - rmt->channel = channel; - rmt->arg = NULL; - - _initPin(pin, channel, tx_not_rx); - - // Initialize the registers in default mode: - // - no carrier, filter - // - timebase tick of 1us - // - idle threshold set to 0x8000 (max pulse width + 1) -#if CONFIG_IDF_TARGET_ESP32C3 - - RMT.sys_conf.fifo_mask = 1; - - if (tx_not_rx) { - RMT.tx_lim[channel].limit = MAX_DATA_PER_ITTERATION/2 + 2; - RMT.tx_conf[channel].val = 0; -// RMT.tx_conf[channel].carrier_en = 0; -// RMT.tx_conf[channel].carrier_out_lv = 0; -// RMT.tx_conf[channel].tx_conti_mode = 0; -// RMT.tx_conf[channel].idle_out_lv = 0; // signal level for idle -// RMT.tx_conf[channel].tx_start = 0; -// RMT.tx_conf[channel].tx_stop = 0; -// RMT.tx_conf[channel].carrier_eff_en = 0; -// RMT.tx_conf[channel].afifo_rst = 0; -// RMT.tx_conf[channel].conf_update = 0; -// RMT.tx_conf[channel].mem_tx_wrap_en = 0; -// RMT.tx_conf[channel].mem_rst = 1; - - RMT.tx_conf[channel].idle_out_en = 1; // enable idle - RMT.tx_conf[channel].div_cnt = 1; - RMT.tx_conf[channel].mem_size = buffers; - RMT.tx_conf[channel].mem_rd_rst = 1; - RMT.tx_conf[channel].conf_update = 1; - } else { - RMT.rx_conf[channel].conf0.div_cnt = 1; - RMT.rx_conf[channel].conf0.mem_size = buffers; - RMT.rx_conf[channel].conf0.carrier_en = 0; - RMT.rx_conf[channel].conf0.carrier_out_lv = 0; - RMT.rx_conf[channel].conf0.idle_thres = 0x80; - RMT.rx_conf[channel].conf1.rx_filter_en = 0; - RMT.rx_conf[channel].conf1.rx_filter_thres = 0; - RMT.rx_conf[channel].conf1.mem_rst = 0; - RMT.rx_conf[channel].conf1.mem_rx_wrap_en = 0; - RMT.rx_conf[channel].conf1.afifo_rst = 0; - RMT.rx_conf[channel].conf1.conf_update = 0; - RMT.rx_conf[channel].conf1.rx_en = 1; - RMT.rx_conf[channel].conf1.mem_owner = 1; - RMT.rx_conf[channel].conf1.mem_wr_rst = 1; - } -#else - RMT.conf_ch[channel].conf0.div_cnt = 1; - RMT.conf_ch[channel].conf0.mem_size = buffers; - RMT.conf_ch[channel].conf0.carrier_en = 0; - RMT.conf_ch[channel].conf0.carrier_out_lv = 0; -#if CONFIG_IDF_TARGET_ESP32 - RMT.conf_ch[channel].conf0.mem_pd = 0; -#endif - RMT.conf_ch[channel].conf0.idle_thres = 0x80; - RMT.conf_ch[channel].conf1.rx_en = 0; - RMT.conf_ch[channel].conf1.tx_conti_mode = 0; -#if CONFIG_IDF_TARGET_ESP32 - RMT.conf_ch[channel].conf1.ref_cnt_rst = 0; -#else - RMT.conf_ch[channel].conf1.chk_rx_carrier_en = 0; -#endif - RMT.conf_ch[channel].conf1.rx_filter_en = 0; - RMT.conf_ch[channel].conf1.rx_filter_thres = 0; - RMT.conf_ch[channel].conf1.idle_out_lv = 0; // signal level for idle - RMT.conf_ch[channel].conf1.idle_out_en = 1; // enable idle - RMT.conf_ch[channel].conf1.ref_always_on = 0; // base clock - - RMT.apb_conf.fifo_mask = 1; + esp_err_t esp_err_code = ESP_OK; if (tx_not_rx) { - // RMT.conf_ch[channel].conf1.rx_en = 0; - RMT.conf_ch[channel].conf1.mem_owner = 0; - RMT.conf_ch[channel].conf1.mem_rd_rst = 1; + rmt_config_t config = RMT_DEFAULT_ARD_CONFIG_TX(pin, channel, buffers); + esp_err_code = rmt_config(&config); + if (esp_err_code == ESP_OK) + esp_err_code = rmt_driver_install(channel, 0, 0); + log_d(" -- %s RMT - CH %d - %d RAM Blocks - pin %d", tx_not_rx?"TX":"RX", channel, buffers, pin); } else { - // RMT.conf_ch[channel].conf1.rx_en = 1; - RMT.conf_ch[channel].conf1.mem_owner = 1; - RMT.conf_ch[channel].conf1.mem_wr_rst = 1; - } -#endif - // install interrupt if at least one channel is active - if (!intr_handle) { - esp_intr_alloc(ETS_RMT_INTR_SOURCE, (int)ARDUINO_ISR_FLAG, _rmt_isr, NULL, &intr_handle); - } - RMT_MUTEX_UNLOCK(channel); + rmt_config_t config = RMT_DEFAULT_ARD_CONFIG_RX(pin, channel, buffers); + esp_err_code = rmt_config(&config); + if (esp_err_code == ESP_OK) + esp_err_code = rmt_driver_install(channel, 1024, 0); + if (esp_err_code == ESP_OK) + esp_err_code = rmt_set_memory_owner(channel, RMT_MEM_OWNER_RX); + log_d(" -- %s RMT - CH %d - %d RAM Blocks - pin %d", tx_not_rx?"TX":"RX", channel, buffers, pin); + } - return rmt; -} - -/** - * Private methods definitions - */ -bool _rmtSendOnce(rmt_obj_t* rmt, rmt_data_t* data, size_t size, bool continuous) -{ - if (!rmt) { - return false; - } - int channel = rmt->channel; -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.sys_conf.fifo_mask = 1; -#else - RMT.apb_conf.fifo_mask = 1; -#endif - if (data && size>0) { - size_t i; - volatile uint32_t* rmt_mem_ptr = &(RMTMEM.chan[channel].data32[0].val); - for (i = 0; i < size; i++) { - *rmt_mem_ptr++ = data[i].val; - } - // tx end mark - RMTMEM.chan[channel].data32[size].val = 0; - } - - RMT_MUTEX_LOCK(channel); -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_conf[channel].tx_conti_mode = continuous; - RMT.tx_conf[channel].mem_rd_rst = 1; - RMT.tx_conf[channel].tx_start = 1; -#else - RMT.conf_ch[channel].conf1.tx_conti_mode = continuous; - RMT.conf_ch[channel].conf1.mem_rd_rst = 1; - RMT.conf_ch[channel].conf1.tx_start = 1; -#endif RMT_MUTEX_UNLOCK(channel); - return true; -} - - -static rmt_obj_t* _rmtAllocate(int pin, int from, int size) -{ - size_t i; - // setup how many buffers shall we use - g_rmt_objects[from].buffers = size; - - for (i=0; i 0) { - size_t i; - uint32_t * data = g_rmt_objects[ch].data_ptr; - // in case of callback, provide switching between memories - if (g_rmt_objects[ch].cb) { - if (g_rmt_objects[ch].tx_state & E_FIRST_HALF) { - g_rmt_objects[ch].tx_state &= ~E_FIRST_HALF; - } else { - g_rmt_objects[ch].tx_state |= E_FIRST_HALF; - data += MAX_DATA_PER_CHANNEL*(g_rmt_objects[ch].buffers); - } - } - uint32_t *data_received = data; - for (i = 0; i < g_rmt_objects[ch].data_size; i++ ) { - *data++ = RMTMEM.chan[ch].data32[i].val; - } - if (g_rmt_objects[ch].cb) { - // actually received data ptr - (g_rmt_objects[ch].cb)(data_received, _rmt_get_mem_len(ch), g_rmt_objects[ch].arg); - - // restart the reception -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.rx_conf[ch].conf1.mem_owner = 1; - RMT.rx_conf[ch].conf1.mem_wr_rst = 1; - RMT.rx_conf[ch].conf1.rx_en = 1; -#else - RMT.conf_ch[ch].conf1.mem_owner = 1; - RMT.conf_ch[ch].conf1.mem_wr_rst = 1; - RMT.conf_ch[ch].conf1.rx_en = 1; -#endif - RMT.int_ena.val |= _INT_RX_END(ch); - } else { - // if not callback provide, expect only one Rx - g_rmt_objects[ch].intr_mode &= ~E_RX_INTR; - } - } - } else { - // Report error and disable Rx interrupt - log_e("Unexpected Rx interrupt!\n"); // TODO: eplace messages with log_X - RMT.int_ena.val &= ~_INT_RX_END(ch); - } - - - } - - if (intr_val & _INT_ERROR(ch)) { - // clear the flag - RMT.int_clr.val = _INT_ERROR(ch); - RMT.int_ena.val &= ~_INT_ERROR(ch); - // report error - log_e("RMT Error %d!\n", ch); - if (g_rmt_objects[ch].events) { - xEventGroupSetBits(g_rmt_objects[ch].events, RMT_FLAG_ERROR); - } - // reset memory -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_conf[ch].mem_rd_rst = 1; - RMT.tx_conf[ch].mem_rd_rst = 0; - RMT.rx_conf[ch].conf1.mem_wr_rst = 1; - RMT.rx_conf[ch].conf1.mem_wr_rst = 0; -#else - RMT.conf_ch[ch].conf1.mem_rd_rst = 1; - RMT.conf_ch[ch].conf1.mem_rd_rst = 0; - RMT.conf_ch[ch].conf1.mem_wr_rst = 1; - RMT.conf_ch[ch].conf1.mem_wr_rst = 0; -#endif - } - - if (intr_val & _INT_TX_END(ch)) { - - RMT.int_clr.val = _INT_TX_END(ch); - _rmt_tx_mem_second(ch); - } - - if (intr_val & _INT_THR_EVNT(ch)) { - // clear the flag - RMT.int_clr.val = _INT_THR_EVNT(ch); -#if CONFIG_IDF_TARGET_ESP32C3 - //RMT.int_clr.val = _INT_TX_END(ch); - //RMT.int_ena.val |= _INT_TX_END(ch); -#endif - - // initial setup of continuous mode - if (g_rmt_objects[ch].tx_state & E_SET_CONTI) { -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_conf[ch].tx_conti_mode = 1; -#else - RMT.conf_ch[ch].conf1.tx_conti_mode = 1; -#endif - g_rmt_objects[ch].intr_mode &= ~E_SET_CONTI; - } - _rmt_tx_mem_first(ch); - } - } - //DEBUG_INTERRUPT_END(4); -} - -static void ARDUINO_ISR_ATTR _rmt_tx_mem_second(uint8_t ch) -{ - DEBUG_INTERRUPT_START(4) - uint32_t* data = g_rmt_objects[ch].data_ptr; - int half_tx_nr = MAX_DATA_PER_ITTERATION/2; - int i; - -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_lim[ch].limit = half_tx_nr+2; -#else - RMT.tx_lim_ch[ch].limit = half_tx_nr+2; -#endif - RMT.int_clr.val = _INT_THR_EVNT(ch); - RMT.int_ena.val |= _INT_THR_EVNT(ch); -#if CONFIG_IDF_TARGET_ESP32C3 - //RMT.int_clr.val = _INT_TX_END(ch); - //RMT.int_ena.val &= ~_INT_TX_END(ch); -#endif - - g_rmt_objects[ch].tx_state |= E_FIRST_HALF; - - if (data) { - int remaining_size = g_rmt_objects[ch].data_size; - //ets_printf("RMT Tx[%d] %d\n", ch, remaining_size); - // will the remaining data occupy the entire halfbuffer - if (remaining_size > half_tx_nr) { - for (i = 0; i < half_tx_nr; i++) { - RMTMEM.chan[ch].data32[half_tx_nr+i].val = data[i]; - } - g_rmt_objects[ch].data_size -= half_tx_nr; - g_rmt_objects[ch].data_ptr += half_tx_nr; - } else { - for (i = 0; i < half_tx_nr; i++) { - if (i < remaining_size) { - RMTMEM.chan[ch].data32[half_tx_nr+i].val = data[i]; - } else { - RMTMEM.chan[ch].data32[half_tx_nr+i].val = 0x000F000F; - } - } - g_rmt_objects[ch].data_ptr = NULL; - - } -#if CONFIG_IDF_TARGET_ESP32C3 - RMTMEM.chan[ch].data32[half_tx_nr+i].val = 0; - RMT.tx_conf[ch].tx_start = 1; -#endif - } else if ((!(g_rmt_objects[ch].tx_state & E_LAST_DATA)) && - (!(g_rmt_objects[ch].tx_state & E_END_TRANS))) { - //ets_printf("RMT Tx finishing %d!\n", ch); - for (i = 0; i < half_tx_nr; i++) { - RMTMEM.chan[ch].data32[half_tx_nr+i].val = 0x000F000F; - } - RMTMEM.chan[ch].data32[half_tx_nr+i].val = 0; - g_rmt_objects[ch].tx_state |= E_LAST_DATA; -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_conf[ch].tx_conti_mode = 0; -#else - RMT.conf_ch[ch].conf1.tx_conti_mode = 0; -#endif - } else { - //ets_printf("RMT Tx finished %d!\n", ch); -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_conf[ch].tx_conti_mode = 0; -#else - RMT.conf_ch[ch].conf1.tx_conti_mode = 0; -#endif - RMT.int_ena.val &= ~_INT_TX_END(ch); - RMT.int_ena.val &= ~_INT_THR_EVNT(ch); - g_rmt_objects[ch].intr_mode = E_NO_INTR; - g_rmt_objects[ch].tx_state = E_INACTIVE; - } - DEBUG_INTERRUPT_END(4); -} - -static void ARDUINO_ISR_ATTR _rmt_tx_mem_first(uint8_t ch) -{ - DEBUG_INTERRUPT_START(2); - uint32_t* data = g_rmt_objects[ch].data_ptr; - int half_tx_nr = MAX_DATA_PER_ITTERATION/2; - int i; - RMT.int_ena.val &= ~_INT_THR_EVNT(ch); -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_lim[ch].limit = 0; -#else - RMT.tx_lim_ch[ch].limit = 0; -#endif - - if (data) { - int remaining_size = g_rmt_objects[ch].data_size; - //ets_printf("RMT TxF[%d] %d\n", ch, remaining_size); - - // will the remaining data occupy the entire halfbuffer - if (remaining_size > half_tx_nr) { - RMTMEM.chan[ch].data32[0].val = data[0] - 1; - for (i = 1; i < half_tx_nr; i++) { - RMTMEM.chan[ch].data32[i].val = data[i]; - } - g_rmt_objects[ch].tx_state &= ~E_FIRST_HALF; - // turn off the treshold interrupt - RMT.int_ena.val &= ~_INT_THR_EVNT(ch); -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_lim[ch].limit = 0; -#else - RMT.tx_lim_ch[ch].limit = 0; -#endif - g_rmt_objects[ch].data_size -= half_tx_nr; - g_rmt_objects[ch].data_ptr += half_tx_nr; - } else { - RMTMEM.chan[ch].data32[0].val = data[0] - 1; - for (i = 1; i < half_tx_nr; i++) { - if (i < remaining_size) { - RMTMEM.chan[ch].data32[i].val = data[i]; - } else { - RMTMEM.chan[ch].data32[i].val = 0x000F000F; - } - } - - g_rmt_objects[ch].tx_state &= ~E_FIRST_HALF; - g_rmt_objects[ch].data_ptr = NULL; - } - } else { - //ets_printf("RMT TxF finished %d!\n", ch); - for (i = 0; i < half_tx_nr; i++) { - RMTMEM.chan[ch].data32[i].val = 0x000F000F; - } - RMTMEM.chan[ch].data32[i].val = 0; - - g_rmt_objects[ch].tx_state &= ~E_FIRST_HALF; -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_lim[ch].limit = 0; -#else - RMT.tx_lim_ch[ch].limit = 0; -#endif - g_rmt_objects[ch].tx_state |= E_LAST_DATA; -#if CONFIG_IDF_TARGET_ESP32C3 - RMT.tx_conf[ch].tx_conti_mode = 0; -#else - RMT.conf_ch[ch].conf1.tx_conti_mode = 0; -#endif - } - DEBUG_INTERRUPT_END(2); -} - -static int ARDUINO_ISR_ATTR _rmt_get_mem_len(uint8_t channel) -{ -#if CONFIG_IDF_TARGET_ESP32C3 - int block_num = RMT.rx_conf[channel].conf0.mem_size; - int item_block_len = block_num * 48; -#else - int block_num = RMT.conf_ch[channel].conf0.mem_size; - int item_block_len = block_num * 64; -#endif - volatile rmt_item32_t* data = RMTMEM.chan[channel].data32; - int idx; - for(idx = 0; idx < item_block_len; idx++) { - if(data[idx].duration0 == 0) { - return idx; - } else if(data[idx].duration1 == 0) { - return idx + 1; - } + log_e("RMT failed to initilize."); + return NULL; } - return idx; } diff --git a/cores/esp32/esp32-hal-rmt.h b/cores/esp32/esp32-hal-rmt.h index cce6c8c8107..201fe594009 100644 --- a/cores/esp32/esp32-hal-rmt.h +++ b/cores/esp32/esp32-hal-rmt.h @@ -25,6 +25,9 @@ extern "C" { #define RMT_FLAG_ERROR (4) #define RMT_FLAGS_ALL (RMT_FLAG_TX_DONE | RMT_FLAG_RX_DONE | RMT_FLAG_ERROR) +#define RMT_TX_MODE true +#define RMT_RX_MODE false + struct rmt_obj_s; typedef enum { @@ -54,6 +57,13 @@ typedef struct { }; } rmt_data_t; + +/** +* Prints object information +* +*/ +void _rmtDumpStatus(rmt_obj_t* rmt); + /** * Initialize the object * @@ -69,10 +79,17 @@ float rmtSetTick(rmt_obj_t* rmt, float tick); /** * Sending data in one-go mode or continual mode * (more data being send while updating buffers in interrupts) -* +* Non-Blocking mode - returns right after executing */ bool rmtWrite(rmt_obj_t* rmt, rmt_data_t* data, size_t size); +/** +* Sending data in one-go mode or continual mode +* (more data being send while updating buffers in interrupts) +* Blocking mode - only returns when data has been sent +*/ +bool rmtWriteBlocking(rmt_obj_t* rmt, rmt_data_t* data, size_t size); + /** * Loop data up to the reserved memsize continuously * diff --git a/cores/esp32/esp32-hal-sigmadelta.c b/cores/esp32/esp32-hal-sigmadelta.c index 4aa778eed24..82ba1a289fb 100644 --- a/cores/esp32/esp32-hal-sigmadelta.c +++ b/cores/esp32/esp32-hal-sigmadelta.c @@ -12,38 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "esp32-hal.h" -#include "freertos/FreeRTOS.h" -#include "freertos/task.h" -#include "freertos/semphr.h" -#include "esp32-hal-matrix.h" -#include "soc/gpio_sd_reg.h" -#include "soc/gpio_sd_struct.h" -#include "esp_system.h" -#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ -#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 -#include "esp32/rom/ets_sys.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/rom/ets_sys.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/rom/ets_sys.h" -#else -#error Target CONFIG_IDF_TARGET is not supported -#endif -#else // ESP32 Before IDF 4.0 -#include "rom/ets_sys.h" -#endif +#include "esp32-hal.h" +#include "soc/soc_caps.h" +#include "driver/sigmadelta.h" -#if CONFIG_DISABLE_HAL_LOCKS -#define SD_MUTEX_LOCK() -#define SD_MUTEX_UNLOCK() -#else -#define SD_MUTEX_LOCK() do {} while (xSemaphoreTake(_sd_sys_lock, portMAX_DELAY) != pdPASS) -#define SD_MUTEX_UNLOCK() xSemaphoreGive(_sd_sys_lock) -xSemaphoreHandle _sd_sys_lock; -#endif +static uint8_t duty_set[SOC_SIGMADELTA_CHANNEL_NUM] = {0}; +static uint32_t prescaler_set[SOC_SIGMADELTA_CHANNEL_NUM] = {0}; static void _on_apb_change(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb){ if(old_apb == new_apb){ @@ -51,82 +27,63 @@ static void _on_apb_change(void * arg, apb_change_ev_t ev_type, uint32_t old_apb } uint32_t iarg = (uint32_t)arg; uint8_t channel = iarg; - if(ev_type == APB_BEFORE_CHANGE){ - SIGMADELTA.cg.clk_en = 0; - } else { + if(ev_type == APB_AFTER_CHANGE){ old_apb /= 1000000; new_apb /= 1000000; - SD_MUTEX_LOCK(); - uint32_t old_prescale = SIGMADELTA.channel[channel].prescale + 1; - SIGMADELTA.channel[channel].prescale = ((new_apb * old_prescale) / old_apb) - 1; - SIGMADELTA.cg.clk_en = 0; - SIGMADELTA.cg.clk_en = 1; - SD_MUTEX_UNLOCK(); + uint32_t old_prescale = prescaler_set[channel] + 1; + uint32_t new_prescale = ((new_apb * old_prescale) / old_apb) - 1; + sigmadelta_set_prescale(channel,new_prescale); + prescaler_set[channel] = new_prescale; } } -uint32_t sigmaDeltaSetup(uint8_t channel, uint32_t freq) //chan 0-7 freq 1220-312500 +uint32_t sigmaDeltaSetup(uint8_t pin, uint8_t channel, uint32_t freq) //chan 0-x according to SOC, freq 1220-312500 { - if(channel > 7) { + if(channel >= SOC_SIGMADELTA_CHANNEL_NUM){ return 0; } -#if !CONFIG_DISABLE_HAL_LOCKS - static bool tHasStarted = false; - if(!tHasStarted) { - tHasStarted = true; - _sd_sys_lock = xSemaphoreCreateMutex(); - } -#endif + uint32_t apb_freq = getApbFrequency(); uint32_t prescale = (apb_freq/(freq*256)) - 1; if(prescale > 0xFF) { prescale = 0xFF; } - SD_MUTEX_LOCK(); -#ifndef CONFIG_IDF_TARGET_ESP32 - SIGMADELTA.misc.function_clk_en = 1; -#endif - SIGMADELTA.channel[channel].prescale = prescale; - SIGMADELTA.cg.clk_en = 0; - SIGMADELTA.cg.clk_en = 1; - SD_MUTEX_UNLOCK(); + + sigmadelta_config_t sigmadelta_cfg = { + .channel = channel, + .sigmadelta_prescale = prescale, + .sigmadelta_duty = 0, + .sigmadelta_gpio = pin, + }; + sigmadelta_config(&sigmadelta_cfg); + + prescaler_set[channel] = prescale; uint32_t iarg = channel; addApbChangeCallback((void*)iarg, _on_apb_change); + return apb_freq/((prescale + 1) * 256); } -void sigmaDeltaWrite(uint8_t channel, uint8_t duty) //chan 0-7 duty 8 bit +void sigmaDeltaWrite(uint8_t channel, uint8_t duty) //chan 0-x according to SOC duty 8 bit { - if(channel > 7) { + if(channel >= SOC_SIGMADELTA_CHANNEL_NUM){ return; } - duty -= 128; - SD_MUTEX_LOCK(); - SIGMADELTA.channel[channel].duty = duty; - SD_MUTEX_UNLOCK(); -} + duty -= 128; -uint8_t sigmaDeltaRead(uint8_t channel) //chan 0-7 -{ - if(channel > 7) { - return 0; - } - SD_MUTEX_LOCK(); - uint8_t duty = SIGMADELTA.channel[channel].duty + 128; - SD_MUTEX_UNLOCK(); - return duty; + sigmadelta_set_duty(channel,duty); + duty_set[channel] = duty; } -void sigmaDeltaAttachPin(uint8_t pin, uint8_t channel) //channel 0-7 +uint8_t sigmaDeltaRead(uint8_t channel) //chan 0-x according to SOC { - if(channel > 7) { - return; + if(channel >= SOC_SIGMADELTA_CHANNEL_NUM){ + return 0; } - pinMode(pin, OUTPUT); - pinMatrixOutAttach(pin, GPIO_SD0_OUT_IDX + channel, false, false); + return duty_set[channel]+128; } void sigmaDeltaDetachPin(uint8_t pin) { pinMatrixOutDetach(pin, false, false); -} +} \ No newline at end of file diff --git a/cores/esp32/esp32-hal-sigmadelta.h b/cores/esp32/esp32-hal-sigmadelta.h index 95bcb17c22c..0a526e8d513 100644 --- a/cores/esp32/esp32-hal-sigmadelta.h +++ b/cores/esp32/esp32-hal-sigmadelta.h @@ -23,10 +23,9 @@ extern "C" { #include //channel 0-7 freq 1220-312500 duty 0-255 -uint32_t sigmaDeltaSetup(uint8_t channel, uint32_t freq); +uint32_t sigmaDeltaSetup(uint8_t pin, uint8_t channel, uint32_t freq); void sigmaDeltaWrite(uint8_t channel, uint8_t duty); uint8_t sigmaDeltaRead(uint8_t channel); -void sigmaDeltaAttachPin(uint8_t pin, uint8_t channel); void sigmaDeltaDetachPin(uint8_t pin); diff --git a/cores/esp32/esp32-hal-timer.c b/cores/esp32/esp32-hal-timer.c index 2375ac60a8d..2c0a18ca9a4 100644 --- a/cores/esp32/esp32-hal-timer.c +++ b/cores/esp32/esp32-hal-timer.c @@ -13,335 +13,227 @@ // limitations under the License. #include "esp32-hal-timer.h" -#include "freertos/FreeRTOS.h" -#ifndef CONFIG_IDF_TARGET_ESP32C3 -#include "freertos/xtensa_api.h" -#include "soc/dport_reg.h" -#endif -#include "freertos/task.h" -#include "soc/timer_group_struct.h" -#include "esp_attr.h" -#include "driver/periph_ctrl.h" - -#include "esp_system.h" -#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ -#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 -#include "esp32/rom/ets_sys.h" -#include "esp_intr_alloc.h" -#elif CONFIG_IDF_TARGET_ESP32S2 -#include "esp32s2/rom/ets_sys.h" -#include "esp_intr_alloc.h" -#include "soc/periph_defs.h" -#elif CONFIG_IDF_TARGET_ESP32C3 -#include "esp32c3/rom/ets_sys.h" -#include "esp_intr_alloc.h" -#include "soc/periph_defs.h" -#else -#error Target CONFIG_IDF_TARGET is not supported -#endif -#else // ESP32 Before IDF 4.0 -#include "rom/ets_sys.h" -#include "esp_intr.h" -#endif - -#define HWTIMER_LOCK() portENTER_CRITICAL(timer->lock) -#define HWTIMER_UNLOCK() portEXIT_CRITICAL(timer->lock) - -typedef volatile struct { - union { - struct { - uint32_t reserved0: 10; - uint32_t alarm_en: 1; /*When set alarm is enabled*/ - uint32_t level_int_en: 1; /*When set level type interrupt will be generated during alarm*/ - uint32_t edge_int_en: 1; /*When set edge type interrupt will be generated during alarm*/ - uint32_t divider: 16; /*Timer clock (T0/1_clk) pre-scale value.*/ - uint32_t autoreload: 1; /*When set timer 0/1 auto-reload at alarming is enabled*/ - uint32_t increase: 1; /*When set timer 0/1 time-base counter increment. When cleared timer 0 time-base counter decrement.*/ - uint32_t enable: 1; /*When set timer 0/1 time-base counter is enabled*/ - }; - uint32_t val; - } config; - uint32_t cnt_low; /*Register to store timer 0/1 time-base counter current value lower 32 bits.*/ - uint32_t cnt_high; /*Register to store timer 0 time-base counter current value higher 32 bits.*/ - uint32_t update; /*Write any value will trigger a timer 0 time-base counter value update (timer 0 current value will be stored in registers above)*/ - uint32_t alarm_low; /*Timer 0 time-base counter value lower 32 bits that will trigger the alarm*/ - uint32_t alarm_high; /*Timer 0 time-base counter value higher 32 bits that will trigger the alarm*/ - uint32_t load_low; /*Lower 32 bits of the value that will load into timer 0 time-base counter*/ - uint32_t load_high; /*higher 32 bits of the value that will load into timer 0 time-base counter*/ - uint32_t reload; /*Write any value will trigger timer 0 time-base counter reload*/ -} hw_timer_reg_t; - -typedef struct hw_timer_s { - hw_timer_reg_t * dev; - uint8_t num; - uint8_t group; - uint8_t timer; - portMUX_TYPE lock; +#include "driver/timer.h" +#include "soc/soc_caps.h" + +typedef union { + struct { + uint32_t reserved0: 10; + uint32_t alarm_en: 1; /*When set alarm is enabled*/ + uint32_t level_int_en: 1; /*When set level type interrupt will be generated during alarm*/ + uint32_t edge_int_en: 1; /*When set edge type interrupt will be generated during alarm*/ + uint32_t divider: 16; /*Timer clock (T0/1_clk) pre-scale value.*/ + uint32_t autoreload: 1; /*When set timer 0/1 auto-reload at alarming is enabled*/ + uint32_t increase: 1; /*When set timer 0/1 time-base counter increment. When cleared timer 0 time-base counter decrement.*/ + uint32_t enable: 1; /*When set timer 0/1 time-base counter is enabled*/ + }; + uint32_t val; +} timer_cfg_t; + +#define NUM_OF_TIMERS SOC_TIMER_GROUP_TOTAL_TIMERS + +typedef struct { + int timer_group; + int timer_idx; + int alarm_interval; + bool auto_reload; +} timer_info_t; + +typedef struct hw_timer_s +{ + uint8_t group; + uint8_t num; } hw_timer_t; -static hw_timer_t hw_timer[4] = { - {(hw_timer_reg_t *)(DR_REG_TIMERGROUP0_BASE),0,0,0,portMUX_INITIALIZER_UNLOCKED}, - {(hw_timer_reg_t *)(DR_REG_TIMERGROUP0_BASE + 0x0024),1,0,1,portMUX_INITIALIZER_UNLOCKED}, - {(hw_timer_reg_t *)(DR_REG_TIMERGROUP0_BASE + 0x1000),2,1,0,portMUX_INITIALIZER_UNLOCKED}, - {(hw_timer_reg_t *)(DR_REG_TIMERGROUP0_BASE + 0x1024),3,1,1,portMUX_INITIALIZER_UNLOCKED} +// Works for all chips +static hw_timer_t timer_dev[4] = { + {0,0}, {1,0}, {1,0}, {1,1} }; -typedef void (*voidFuncPtr)(void); -static voidFuncPtr __timerInterruptHandlers[4] = {0,0,0,0}; - -void ARDUINO_ISR_ATTR __timerISR(void * arg){ - uint32_t s0 = TIMERG0.int_st_timers.val; - uint32_t s1 = TIMERG1.int_st_timers.val; - TIMERG0.int_clr_timers.val = s0; - TIMERG1.int_clr_timers.val = s1; - uint8_t status = (s1 & 3) << 2 | (s0 & 3); - uint8_t i = 4; - //restart the timers that should autoreload - while(i--){ - hw_timer_reg_t * dev = hw_timer[i].dev; - if((status & (1 << i)) && dev->config.autoreload){ - dev->config.alarm_en = 1; - } - } - i = 4; - //call callbacks - while(i--){ - if(__timerInterruptHandlers[i] && (status & (1 << i))){ - __timerInterruptHandlers[i](); - } - } -} +// NOTE: (in IDF 5.0 there wont be need to know groups/numbers +// timer_init() will list thru all timers and return free timer handle) + uint64_t inline timerRead(hw_timer_t *timer){ - timer->dev->update = 1; - while (timer->dev->update) {}; - uint64_t h = timer->dev->cnt_high; - uint64_t l = timer->dev->cnt_low; - return (h << 32) | l; + + uint64_t value; + timer_get_counter_value(timer->group, timer->num,&value); + return value; } uint64_t timerAlarmRead(hw_timer_t *timer){ - uint64_t h = timer->dev->alarm_high; - uint64_t l = timer->dev->alarm_low; - return (h << 32) | l; + uint64_t value; + timer_get_alarm_value(timer->group, timer->num, &value); + return value; } void timerWrite(hw_timer_t *timer, uint64_t val){ - timer->dev->load_high = (uint32_t) (val >> 32); - timer->dev->load_low = (uint32_t) (val); - timer->dev->reload = 1; + timer_set_counter_value(timer->group, timer->num, val); } void timerAlarmWrite(hw_timer_t *timer, uint64_t alarm_value, bool autoreload){ - timer->dev->alarm_high = (uint32_t) (alarm_value >> 32); - timer->dev->alarm_low = (uint32_t) alarm_value; - timer->dev->config.autoreload = autoreload; + timer_set_alarm_value(timer->group, timer->num, alarm_value); + timerSetAutoReload(timer,autoreload); } void timerSetConfig(hw_timer_t *timer, uint32_t config){ - timer->dev->config.val = config; + timer_cfg_t cfg; + cfg.val = config; + timer_set_alarm(timer->group, timer->num, cfg.alarm_en); + timerSetDivider(timer,cfg.divider); + timerSetAutoReload(timer,cfg.autoreload); + timerSetCountUp(timer, cfg.increase); + + if (cfg.enable) { + timerStart(timer); + } + else{ + timerStop(timer); + } + return; } uint32_t timerGetConfig(hw_timer_t *timer){ - return timer->dev->config.val; + timer_config_t timer_cfg; + timer_get_config(timer->group, timer->num,&timer_cfg); + + //Translate to default uint32_t + timer_cfg_t cfg; + cfg.alarm_en = timer_cfg.alarm_en; + cfg.autoreload = timer_cfg.auto_reload; + cfg.divider = timer_cfg.divider; + cfg.edge_int_en = timer_cfg.intr_type; + cfg.level_int_en = !timer_cfg.intr_type; + cfg.enable = timer_cfg.counter_en; + cfg.increase = timer_cfg.counter_dir; + + return cfg.val; } void timerSetCountUp(hw_timer_t *timer, bool countUp){ - timer->dev->config.increase = countUp; + timer_set_counter_mode(timer->group, timer->num,countUp); } bool timerGetCountUp(hw_timer_t *timer){ - return timer->dev->config.increase; + timer_cfg_t config; + config.val = timerGetConfig(timer); + return config.increase; } void timerSetAutoReload(hw_timer_t *timer, bool autoreload){ - timer->dev->config.autoreload = autoreload; + timer_set_auto_reload(timer->group, timer->num,autoreload); } bool timerGetAutoReload(hw_timer_t *timer){ - return timer->dev->config.autoreload; + timer_cfg_t config; + config.val= timerGetConfig(timer); + return config.autoreload; } -void timerSetDivider(hw_timer_t *timer, uint16_t divider){//2 to 65536 - if(!divider){ - divider = 0xFFFF; - } else if(divider == 1){ - divider = 2; +// Set divider from 2 to 65535 +void timerSetDivider(hw_timer_t *timer, uint16_t divider){ + if(divider < 2) + { + log_e("Timer divider must be set in range of 2 to 65535"); + return; } - int timer_en = timer->dev->config.enable; - timer->dev->config.enable = 0; - timer->dev->config.divider = divider; - timer->dev->config.enable = timer_en; + timer_set_divider(timer->group, timer->num,divider); } uint16_t timerGetDivider(hw_timer_t *timer){ - return timer->dev->config.divider; + timer_cfg_t config; + config.val = timerGetConfig(timer); + return config.divider; } void timerStart(hw_timer_t *timer){ - timer->dev->config.enable = 1; + timer_start(timer->group, timer->num); } void timerStop(hw_timer_t *timer){ - timer->dev->config.enable = 0; + timer_pause(timer->group, timer->num); } void timerRestart(hw_timer_t *timer){ - timer->dev->config.enable = 0; - timer->dev->reload = 1; - timer->dev->config.enable = 1; + timerWrite(timer,0); } bool timerStarted(hw_timer_t *timer){ - return timer->dev->config.enable; + timer_cfg_t config; + config.val = timerGetConfig(timer); + return config.enable; } void timerAlarmEnable(hw_timer_t *timer){ - timer->dev->config.alarm_en = 1; + timer_set_alarm(timer->group, timer->num,true); } void timerAlarmDisable(hw_timer_t *timer){ - timer->dev->config.alarm_en = 0; + timer_set_alarm(timer->group, timer->num,false); } bool timerAlarmEnabled(hw_timer_t *timer){ - return timer->dev->config.alarm_en; + timer_cfg_t config; + config.val = timerGetConfig(timer); + return config.alarm_en; } static void _on_apb_change(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb){ hw_timer_t * timer = (hw_timer_t *)arg; if(ev_type == APB_BEFORE_CHANGE){ - timer->dev->config.enable = 0; + timerStop(timer); } else { old_apb /= 1000000; new_apb /= 1000000; - timer->dev->config.divider = (new_apb * timer->dev->config.divider) / old_apb; - timer->dev->config.enable = 1; + uint16_t divider = (new_apb * timerGetDivider(timer)) / old_apb; + timerSetDivider(timer,divider); + timerStart(timer); } } hw_timer_t * timerBegin(uint8_t num, uint16_t divider, bool countUp){ - if(num > 3){ + if(num >= NUM_OF_TIMERS) + { + log_e("Timer dont have that timer number."); return NULL; } - hw_timer_t * timer = &hw_timer[num]; - if(timer->group) { - periph_module_enable(PERIPH_TIMG1_MODULE); - } else { - periph_module_enable(PERIPH_TIMG0_MODULE); - } - timer->dev->config.enable = 0; - if(timer->group) { -#if CONFIG_IDF_TARGET_ESP32 - TIMERG1.int_ena.val &= ~BIT(timer->timer); -#else - TIMERG1.int_ena_timers.val &= ~BIT(timer->timer); -#endif - TIMERG1.int_clr_timers.val |= BIT(timer->timer); - } else { -#if CONFIG_IDF_TARGET_ESP32 - TIMERG0.int_ena.val &= ~BIT(timer->timer); -#else - TIMERG0.int_ena_timers.val &= ~BIT(timer->timer); -#endif - TIMERG0.int_clr_timers.val |= BIT(timer->timer); - } -#ifdef TIMER_GROUP_SUPPORTS_XTAL_CLOCK - timer->dev->config.use_xtal = 0; -#endif - timerSetDivider(timer, divider); - timerSetCountUp(timer, countUp); - timerSetAutoReload(timer, false); - timerAttachInterrupt(timer, NULL, false); - timerWrite(timer, 0); - timer->dev->config.enable = 1; + + hw_timer_t * timer = &timer_dev[num]; //Get Timer group/num from 0-3 number + + timer_config_t config = { + .divider = divider, + .counter_dir = countUp, + .counter_en = TIMER_PAUSE, + .alarm_en = TIMER_ALARM_DIS, + .auto_reload = false, + }; + + timer_init(timer->group, timer->num, &config); + timer_set_counter_value(timer->group, timer->num, 0); + timerStart(timer); addApbChangeCallback(timer, _on_apb_change); return timer; } void timerEnd(hw_timer_t *timer){ - timer->dev->config.enable = 0; - timerAttachInterrupt(timer, NULL, false); removeApbChangeCallback(timer, _on_apb_change); + timer_deinit(timer->group, timer->num); } void timerAttachInterrupt(hw_timer_t *timer, void (*fn)(void), bool edge){ -#if CONFIG_IDF_TARGET_ESP32 if(edge){ - log_w("EDGE timer interrupt does not work properly on ESP32! Setting to LEVEL..."); + log_w("EDGE timer interrupt is not supported! Setting to LEVEL..."); edge = false; } -#endif - static bool initialized = false; - static intr_handle_t intr_handle = NULL; - if(intr_handle){ - esp_intr_disable(intr_handle); - } - if(fn == NULL){ - timer->dev->config.level_int_en = 0; - timer->dev->config.edge_int_en = 0; - timer->dev->config.alarm_en = 0; - if(timer->num & 2){ -#if CONFIG_IDF_TARGET_ESP32 - TIMERG1.int_ena.val &= ~BIT(timer->timer); -#else - TIMERG1.int_ena_timers.val &= ~BIT(timer->timer); -#endif - TIMERG1.int_clr_timers.val |= BIT(timer->timer); - } else { -#if CONFIG_IDF_TARGET_ESP32 - TIMERG0.int_ena.val &= ~BIT(timer->timer); -#else - TIMERG0.int_ena_timers.val &= ~BIT(timer->timer); -#endif - TIMERG0.int_clr_timers.val |= BIT(timer->timer); - } - __timerInterruptHandlers[timer->num] = NULL; - } else { - __timerInterruptHandlers[timer->num] = fn; - timer->dev->config.level_int_en = edge?0:1;//When set, an alarm will generate a level type interrupt. - timer->dev->config.edge_int_en = edge?1:0;//When set, an alarm will generate an edge type interrupt. - int intr_source = 0; -#ifndef CONFIG_IDF_TARGET_ESP32C3 - if(!edge){ -#endif - if(timer->group){ - intr_source = ETS_TG1_T0_LEVEL_INTR_SOURCE + timer->timer; - } else { - intr_source = ETS_TG0_T0_LEVEL_INTR_SOURCE + timer->timer; - } -#ifndef CONFIG_IDF_TARGET_ESP32C3 - } else { - if(timer->group){ - intr_source = ETS_TG1_T0_EDGE_INTR_SOURCE + timer->timer; - } else { - intr_source = ETS_TG0_T0_EDGE_INTR_SOURCE + timer->timer; - } - } -#endif - if(!initialized){ - initialized = true; - esp_intr_alloc(intr_source, (int)(ARDUINO_ISR_FLAG|ESP_INTR_FLAG_LOWMED), __timerISR, NULL, &intr_handle); - } else { - intr_matrix_set(esp_intr_get_cpu(intr_handle), intr_source, esp_intr_get_intno(intr_handle)); - } - if(timer->group){ -#if CONFIG_IDF_TARGET_ESP32 - TIMERG1.int_ena.val |= BIT(timer->timer); -#else - TIMERG1.int_ena_timers.val |= BIT(timer->timer); -#endif - } else { -#if CONFIG_IDF_TARGET_ESP32 - TIMERG0.int_ena.val |= BIT(timer->timer); -#else - TIMERG0.int_ena_timers.val |= BIT(timer->timer); -#endif - } - } - if(intr_handle){ - esp_intr_enable(intr_handle); - } + timer_enable_intr(timer->group, timer->num); + + timer_info_t *timer_info = calloc(1, sizeof(timer_info_t)); + timer_info->timer_group = timer->group; + timer_info->timer_idx = timer->num; + timer_info->auto_reload = timerGetAutoReload(timer); + timer_info->alarm_interval = timerAlarmRead(timer); + + timer_isr_callback_add(timer->group, timer->num, (timer_isr_t)fn, timer_info, 0); } void timerDetachInterrupt(hw_timer_t *timer){ @@ -354,6 +246,12 @@ uint64_t timerReadMicros(hw_timer_t *timer){ return timer_val * div / (getApbFrequency() / 1000000); } +uint64_t timerReadMilis(hw_timer_t *timer){ + uint64_t timer_val = timerRead(timer); + uint16_t div = timerGetDivider(timer); + return timer_val * div / (getApbFrequency() / 1000); +} + double timerReadSeconds(hw_timer_t *timer){ uint64_t timer_val = timerRead(timer); uint16_t div = timerGetDivider(timer); @@ -366,6 +264,12 @@ uint64_t timerAlarmReadMicros(hw_timer_t *timer){ return timer_val * div / (getApbFrequency() / 1000000); } +uint64_t timerAlarmReadMilis(hw_timer_t *timer){ + uint64_t timer_val = timerAlarmRead(timer); + uint16_t div = timerGetDivider(timer); + return timer_val * div / (getApbFrequency() / 1000); +} + double timerAlarmReadSeconds(hw_timer_t *timer){ uint64_t timer_val = timerAlarmRead(timer); uint16_t div = timerGetDivider(timer); diff --git a/cores/esp32/esp32-hal-timer.h b/cores/esp32/esp32-hal-timer.h index 7624fc5a9f6..7d0fe1f6336 100644 --- a/cores/esp32/esp32-hal-timer.h +++ b/cores/esp32/esp32-hal-timer.h @@ -20,13 +20,13 @@ #ifndef MAIN_ESP32_HAL_TIMER_H_ #define MAIN_ESP32_HAL_TIMER_H_ +#include "esp32-hal.h" +#include "freertos/FreeRTOS.h" + #ifdef __cplusplus extern "C" { #endif -#include "esp32-hal.h" -#include "freertos/FreeRTOS.h" - struct hw_timer_s; typedef struct hw_timer_s hw_timer_t; @@ -50,6 +50,7 @@ void timerSetAutoReload(hw_timer_t *timer, bool autoreload); bool timerStarted(hw_timer_t *timer); uint64_t timerRead(hw_timer_t *timer); uint64_t timerReadMicros(hw_timer_t *timer); +uint64_t timerReadMilis(hw_timer_t *timer); double timerReadSeconds(hw_timer_t *timer); uint16_t timerGetDivider(hw_timer_t *timer); bool timerGetCountUp(hw_timer_t *timer); diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index c3f2df37207..c34c54b1a25 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -69,6 +69,19 @@ static uart_t _uart_bus_array[] = { #endif +// solves issue https://github.com/espressif/arduino-esp32/issues/6032 +// baudrate must be multiplied when CPU Frequency is lower than APB 80MHz +uint32_t _get_effective_baudrate(uint32_t baudrate) +{ + uint32_t Freq = getApbFrequency()/1000000; + if (Freq < 80) { + return 80 / Freq * baudrate; + } + else { + return baudrate; + } +} + bool uartIsDriverInstalled(uart_t* uart) { if(uart == NULL) { @@ -121,7 +134,7 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx UART_MUTEX_LOCK(); uart_config_t uart_config; - uart_config.baud_rate = baudrate; + uart_config.baud_rate = _get_effective_baudrate(baudrate); uart_config.data_bits = (config & 0xc) >> 2; uart_config.parity = (config & 0x3); uart_config.stop_bits = (config & 0x30) >> 4; @@ -140,6 +153,9 @@ uart_t* uartBegin(uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rx ESP_ERROR_CHECK(uart_set_line_inverse(uart_nr, UART_SIGNAL_TXD_INV | UART_SIGNAL_RXD_INV)); } + // Set RS485 half duplex mode on UART. This shall force flush to wait up to sending all bits out + ESP_ERROR_CHECK(uart_set_mode(uart_nr, UART_MODE_RS485_HALF_DUPLEX)); + UART_MUTEX_UNLOCK(); uartFlush(uart); @@ -304,7 +320,7 @@ void uartSetBaudRate(uart_t* uart, uint32_t baud_rate) return; } UART_MUTEX_LOCK(); - uart_ll_set_baudrate(UART_LL_GET_HW(uart->num), baud_rate); + uart_ll_set_baudrate(UART_LL_GET_HW(uart->num), _get_effective_baudrate(baud_rate)); UART_MUTEX_UNLOCK(); } diff --git a/cores/esp32/libb64/AUTHORS b/cores/esp32/libb64/AUTHORS old mode 100755 new mode 100644 diff --git a/cores/esp32/libb64/LICENSE b/cores/esp32/libb64/LICENSE old mode 100755 new mode 100644 diff --git a/cores/esp32/libb64/cdecode.c b/cores/esp32/libb64/cdecode.c old mode 100755 new mode 100644 diff --git a/cores/esp32/libb64/cdecode.h b/cores/esp32/libb64/cdecode.h old mode 100755 new mode 100644 diff --git a/cores/esp32/libb64/cencode.c b/cores/esp32/libb64/cencode.c old mode 100755 new mode 100644 diff --git a/cores/esp32/libb64/cencode.h b/cores/esp32/libb64/cencode.h old mode 100755 new mode 100644 diff --git a/cores/esp32/main.cpp b/cores/esp32/main.cpp index 903e80f1748..f4e79844818 100644 --- a/cores/esp32/main.cpp +++ b/cores/esp32/main.cpp @@ -33,6 +33,10 @@ void yieldIfNecessary(void){ bool loopTaskWDTEnabled; +__attribute__((weak)) size_t getArduinoLoopTaskStackSize(void) { + return ARDUINO_LOOP_STACK_SIZE; +} + void loopTask(void *pvParameters) { setup(); @@ -64,7 +68,7 @@ extern "C" void app_main() #endif loopTaskWDTEnabled = false; initArduino(); - xTaskCreateUniversal(loopTask, "loopTask", ARDUINO_LOOP_STACK_SIZE, NULL, 1, &loopTaskHandle, ARDUINO_RUNNING_CORE); + xTaskCreateUniversal(loopTask, "loopTask", getArduinoLoopTaskStackSize(), NULL, 1, &loopTaskHandle, ARDUINO_RUNNING_CORE); } #endif diff --git a/docs/source/_static/gpio_output.png b/docs/source/_static/gpio_output.png new file mode 100644 index 00000000000..877ead7ef77 Binary files /dev/null and b/docs/source/_static/gpio_output.png differ diff --git a/docs/source/_static/gpio_pullup.png b/docs/source/_static/gpio_pullup.png new file mode 100644 index 00000000000..5c31464f4e9 Binary files /dev/null and b/docs/source/_static/gpio_pullup.png differ diff --git a/docs/source/api/gpio.rst b/docs/source/api/gpio.rst index 998f0436586..2f63f26e00f 100644 --- a/docs/source/api/gpio.rst +++ b/docs/source/api/gpio.rst @@ -1,3 +1,170 @@ #### GPIO #### + +About +----- + +One of the most used and versatile peripheral in a microcontroller is the GPIO. The GPIO is commonly used to write and read the pin state. + +GPIO stands to General Purpose Input Output, and is responsible to control or read the state of a specific pin in the digital world. For example, this peripheral is widely used to create the LED blinking or to read a simple button. + +.. note:: There are some GPIOs with special restrictions, and not all GPIOs are accessible through the developemnt board. For more information about it, see the corresponding board pin layout information. + +GPIOs Modes +*********** + +There are two different modes in the GPIO configuration: + +- **Input Mode** + +In this mode, the GPIO will receive the digital state from a specific device. This device could be a button or a switch. + +- **Output Mode** + +For the output mode, the GPIO will change the GPIO digital state to a specific device. You can drive an LED for example. + +GPIO API +-------- + +Here is the common functions used for the GPIO peripheral. + +pinMode +******* + +The ``pinMode`` function is used to define the GPIO operation mode for a specific pin. + +.. code-block:: arduino + + void pinMode(uint8_t pin, uint8_t mode); + +* ``pin`` defines the GPIO pin number. +* ``mode`` sets operation mode. + +The following modes are supported for the basic `input` and `output`: + +* **INPUT** sets the GPIO as input without pullup or pulldown (high impedance). +* **OUTPUT** sets the GPIO as output/read mode. +* **INPUT_PULLDOWN** sets the GPIO as input with the internal pulldown. +* **INPUT_PULLUP** sets the GPIO as input with the internal pullup. + +Internal Pullup and Pulldown +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The ESP32 SoC families supports the internal pullup and pulldown throught a 45kR resistor, that can be enabled when configuring the GPIO mode as ``INPUT`` mode. +If the pullup or pulldown mode is not defined, the pin will stay in the high impedance mode. + +digitalWrite +************* + +The function ``digitalWrite`` sets the state of the selected GPIO to ``HIGH`` or ``LOW``. This function is only used if the ``pinMode`` was configured as ``OUTPUT``. + +.. code-block:: arduino + + void digitalWrite(uint8_t pin, uint8_t val); + +* ``pin`` defines the GPIO pin number. +* ``val`` set the output digital state to ``HIGH`` or ``LOW``. + +digitalRead +*********** + +To read the state of a given pin configured as ``INPUT``, the function ``digitalRead`` is used. + +.. code-block:: arduino + + int digitalRead(uint8_t pin); + +* ``pin`` select GPIO + +This function will return the logical state of the selected pin as ``HIGH`` or ``LOW``. + +Interrupts +---------- + +The GPIO peripheral on the ESP32 supports interruptions. + +attachInterrupt +*************** + +The function ``attachInterruptArg`` is used to attach the interrupt to the defined pin. + +.. code-block:: arduino + + attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode); + +* ``pin`` defines the GPIO pin number. +* ``handler`` set the handler function. +* ``mode`` set the interrupt mode. + +Here are the supported interrupt modes: + +* **DISABLED** +* **RISING** +* **FALLING** +* **CHANGE** +* **ONLOW** +* **ONHIGH** +* **ONLOW_WE** +* **ONHIGH_WE** + +attachInterruptArg +****************** + +The function ``attachInterruptArg`` is used to attach the interrupt to the defined pin using arguments. + +.. code-block:: arduino + + attachInterruptArg(uint8_t pin, voidFuncPtrArg handler, void * arg, int mode); + +* ``pin`` defines the GPIO pin number. +* ``handler`` set the handler function. +* ``arg`` pointer to the interrupt arguments. +* ``mode`` set the interrupt mode. + +detachInterrupt +*************** + +To detach the interruption from a specific pin, use the ``detachInterrupt`` function giving the GPIO to be detached. + +.. code-block:: arduino + + detachInterrupt(uint8_t pin); + +* ``pin`` defines the GPIO pin number. + +.. _gpio_example_code: + +Example Code +------------ + +GPIO Input and Output Modes +*************************** + +.. code-block:: arduino + + #define LED 12 + #define BUTTON 2 + + uint8_t stateLED = 0; + + void setup() { + pinMode(LED, OUTPUT); + pinMode(BUTTON,INPUT_PULLUP); + } + + void loop() { + + if(!digitalRead(BUTTON)){ + stateLED = stateLED^1; + digitalWrite(LED,stateLED); + } + } + +GPIO Interrupt +************** + +.. literalinclude:: ../../../libraries/ESP32/examples/GPIO/GPIOInterrupt/GPIOInterrupt.ino + :language: arduino + +.. _datasheet: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf diff --git a/docs/source/api/usb.rst b/docs/source/api/usb.rst new file mode 100644 index 00000000000..94261185f61 --- /dev/null +++ b/docs/source/api/usb.rst @@ -0,0 +1,331 @@ +####### +USB API +####### + +.. note:: This feature is only supported on ESP chips that have USB peripheral, like the ESP32-S2 and ESP32-S3. Some chips, like the ESP32-C3 include native CDC+JTAG peripheral that is not covered here. + +About +----- + +The **Universal Serial Bus** is a widely used peripheral to exchange data between devices. USB was introduced on the ESP32, supporting both device and host mode. + +To learn about the USB, see the `USB.org`_ for developers. + +USB as Device +************* + +In the device mode, the ESP32 acts as an USB device, like a mouse or keyboard to be connected to a host device, like your computer or smartphone. + +USB as Host +*********** + +The USB host mode, you can connect devices on the ESP32, like external modems, mouse and keyboards. + +.. note:: This mode is still under development for the ESP32. + +API Description +--------------- + +This is the common USB API description. + +For more supported USB classes implementation, see the following sections: + +.. toctree:: + :maxdepth: 1 + :caption: Classes: + + USB CDC + USB MSC + +USB Common +********** + +These are the common APIs for the USB driver. + +onEvent +^^^^^^^ + +Event handling function to set the callback. + +.. code-block:: arduino + + void onEvent(esp_event_handler_t callback); + +Event handling function for the specific event. + +.. code-block:: arduino + + void onEvent(arduino_usb_event_t event, esp_event_handler_t callback); + +Where ``event`` can be: + +* ARDUINO_USB_ANY_EVENT +* ARDUINO_USB_STARTED_EVENT +* ARDUINO_USB_STOPPED_EVENT +* ARDUINO_USB_SUSPEND_EVENT +* ARDUINO_USB_RESUME_EVENT +* ARDUINO_USB_MAX_EVENT + +VID +^^^ + +Set the Vendor ID. This 16 bits identification is used to identify the company that develops the product. + +.. note:: You can't define your own VID. If you need your own VID, you need to buy one. See https://www.usb.org/getting-vendor-id for more details. + +.. code-block:: arduino + + bool VID(uint16_t v); + + +Get the Vendor ID. + +.. code-block:: arduino + + uint16_t VID(void); + +Returns the Vendor ID. The default value for the VID is: ``0x303A``. + +PID +^^^ + +Set the Product ID. This 16 bits identification is used to identify the product. + +.. code-block:: arduino + + bool PID(uint16_t p); + +Get the Product ID. + +.. code-block:: arduino + + uint16_t PID(void); + +Returns the Product ID. The default PID is: ``0x0002``. + +firmwareVersion +^^^^^^^^^^^^^^^ + +Set the firmware version. This is a 16 bits unsigned value. + +.. code-block:: arduino + + bool firmwareVersion(uint16_t version); + +Get the firmware version. + +.. code-block:: arduino + + uint16_t firmwareVersion(void); + +Return the 16 bits unsigned value. The default value is: ``0x100``. + +usbVersion +^^^^^^^^^^ + +Set the USB version. + +.. code-block:: arduino + + bool usbVersion(uint16_t version); + +Get the USB version. + +.. code-block:: arduino + + uint16_t usbVersion(void); + +Return the USB version. The default value is: ``0x200`` (USB 2.0). + +usbPower +^^^^^^^^ + +Set the USB power as mA (current). + +.. note:: This configuration does not change the physical power output. This is only used for the USB device information. + +.. code-block:: arduino + + bool usbPower(uint16_t mA); + +Get the USB power configuration. + +.. code-block:: arduino + + uint16_t usbPower(void); + +Return the current in mA. The default value is: ``0x500`` (500mA). + +usbClass +^^^^^^^^ + +Set the USB class. + +.. code-block:: arduino + + bool usbClass(uint8_t _class); + +Get the USB class. + +.. code-block:: arduino + + uint8_t usbClass(void); + +Return the USB class. The default value is: ``TUSB_CLASS_MISC``. + +usbSubClass +^^^^^^^^^^^ + +Set the USB sub-class. + +.. code-block:: arduino + + bool usbSubClass(uint8_t subClass); + +Get the USB sub-class. + +.. code-block:: arduino + + uint8_t usbSubClass(void); + +Return the USB sub-class. The default value is: ``MISC_SUBCLASS_COMMON``. + +usbProtocol +^^^^^^^^^^^ + +Define the USB protocol. + +.. code-block:: arduino + + bool usbProtocol(uint8_t protocol); + +Get the USB protocol. + +.. code-block:: arduino + + uint8_t usbProtocol(void); + +Return the USB protocol. The default value is: ``MISC_PROTOCOL_IAD`` + +usbAttributes +^^^^^^^^^^^^^ + +Set the USB attributes. + +.. code-block:: arduino + + bool usbAttributes(uint8_t attr); + +Get the USB attributes. + +.. code-block:: arduino + + uint8_t usbAttributes(void); + +Return the USB attributes. The default value is: ``TUSB_DESC_CONFIG_ATT_SELF_POWERED`` + +webUSB +^^^^^^ + +This function is used to enable the ``webUSB`` functionality. + +.. code-block:: arduino + + bool webUSB(bool enabled); + +This function is used to get the ``webUSB`` setting. + +.. code-block:: arduino + + bool webUSB(void); + +Return the ``webUSB`` setting (`Enabled` or `Disabled`) + +productName +^^^^^^^^^^^ + +This function is used to define the product name. + +.. code-block:: arduino + + bool productName(const char * name); + +This function is used to get the product's name. + +.. code-block:: arduino + + const char * productName(void); + +manufacturerName +^^^^^^^^^^^^^^^^ + +This function is used to define the manufacturer name. + +.. code-block:: arduino + + bool manufacturerName(const char * name); + +This function is used to get the manufacturer's name. + +.. code-block:: arduino + + const char * manufacturerName(void); + +serialNumber +^^^^^^^^^^^^ + +This function is used to define the serial number. + +.. code-block:: arduino + + bool serialNumber(const char * name); + +This function is used to get the serial number. + +.. code-block:: arduino + + const char * serialNumber(void); + +The default serial number is: ``0``. + +webUSBURL +^^^^^^^^^ + +This function is used to define the ``webUSBURL``. + +.. code-block:: arduino + + bool webUSBURL(const char * name); + +This function is used to get the ``webUSBURL``. + +.. code-block:: arduino + + const char * webUSBURL(void); + +The default ``webUSBURL`` is: https://espressif.github.io/arduino-esp32/webusb.html + +enableDFU +^^^^^^^^^ + +This function is used to enable the DFU capability. + +.. code-block:: arduino + + bool enableDFU(); + +begin +^^^^^ + +This function is used to start the peripheral using the default configuration. + +.. code-block:: arduino + + bool begin(); + +Example Code +------------ + +There are a collection of USB device examples on the project GitHub, including Firmware MSC update, USB CDC, HID and composite device. + +.. _USB.org: https://www.usb.org/developers diff --git a/docs/source/api/usb_cdc.rst b/docs/source/api/usb_cdc.rst new file mode 100644 index 00000000000..1c0b04f2f3c --- /dev/null +++ b/docs/source/api/usb_cdc.rst @@ -0,0 +1,192 @@ +####### +USB CDC +####### + +About +----- + +USB Communications Device Class API. This class is used to enable communication between the host and the device. + +This class is often used to enable serial communication and can be used to flash the firmware on the ESP32 without the external USB to Serial chip. + +APIs +**** + +onEvent +^^^^^^^ + +Event handling functions. + +.. code-block:: arduino + + void onEvent(esp_event_handler_t callback); + +.. code-block:: arduino + + void onEvent(arduino_usb_cdc_event_t event, esp_event_handler_t callback); + +Where ``event`` can be: + +* ARDUINO_USB_CDC_ANY_EVENT +* ARDUINO_USB_CDC_CONNECTED_EVENT +* ARDUINO_USB_CDC_DISCONNECTED_EVENT +* ARDUINO_USB_CDC_LINE_STATE_EVENT +* ARDUINO_USB_CDC_LINE_CODING_EVENT +* ARDUINO_USB_CDC_RX_EVENT +* ARDUINO_USB_CDC_TX_EVENT +* ARDUINO_USB_CDC_MAX_EVENT + +setRxBufferSize +^^^^^^^^^^^^^^^ + +The ``setRxBufferSize`` function is used to set the size of the RX buffer. + +.. code-block:: arduino + + size_t setRxBufferSize(size_t size); + +setTxTimeoutMs +^^^^^^^^^^^^^^ + +This function is used to define the time to reach the timeout for the TX. + +.. code-block:: arduino + + void setTxTimeoutMs(uint32_t timeout); + +begin +^^^^^ + +This function is used to start the peripheral using the default CDC configuration. + +.. code-block:: arduino + + void begin(unsigned long baud); + +Where: + +* ``baud`` is the baud rate. + +end +^^^ + +This function will finish the peripheral as CDC and release all the allocated resources. After calling ``end`` you need to use ``begin`` again in order to initialize the USB CDC driver again. + +.. code-block:: arduino + + void end(); + +available +^^^^^^^^^ + +This function will return if there are messages in the queue. + +.. code-block:: arduino + + int available(void); + +The return is the number of bytes available to read. + +availableForWrite +^^^^^^^^^^^^^^^^^ + +This function will return if the hardware is available to write data. + +.. code-block:: arduino + + int availableForWrite(void); + +peek +^^^^ + +This function is used to ``peek`` messages from the queue. + +.. code-block:: arduino + + int peek(void); + +read +^^^^ + +This function is used to read the bytes available. + +.. code-block:: arduino + + size_t read(uint8_t *buffer, size_t size); + +Where: + +* ``buffer`` is the pointer to the buffer to be read. +* ``size`` is the number of bytes to be read. + +write +^^^^^ + +This function is used to write the message. + +.. code-block:: arduino + + size_t write(const uint8_t *buffer, size_t size); + +Where: + +* ``buffer`` is the pointer to the buffer to be written. +* ``size`` is the number of bytes to be written. + +flush +^^^^^ + +This function is used to flush the data. + +.. code-block:: arduino + + void flush(void); + +baudRate +^^^^^^^^ + +This function is used to get the ``baudRate``. + +.. code-block:: arduino + + uint32_t baudRate(); + +setDebugOutput +^^^^^^^^^^^^^^ + +This function will enable the debug output, usually from the `UART0`, to the USB CDC. + +.. code-block:: arduino + + void setDebugOutput(bool); + +enableReboot +^^^^^^^^^^^^ + +This function enables the device to reboot by the DTR as RTS signals. + +.. code-block:: arduino + + void enableReboot(bool enable); + +rebootEnabled +^^^^^^^^^^^^^ + +This function will return if the reboot is enabled. + +.. code-block:: arduino + + bool rebootEnabled(void); + +Example Code +------------ + +Here is an example of how to use the USB CDC. + +USBSerial +********* + +.. literalinclude:: ../../../libraries/USB/examples/USBSerial/USBSerial.ino + :language: arduino + +.. _USB.org: https://www.usb.org/developers diff --git a/docs/source/api/usb_msc.rst b/docs/source/api/usb_msc.rst new file mode 100644 index 00000000000..846e72e8db0 --- /dev/null +++ b/docs/source/api/usb_msc.rst @@ -0,0 +1,114 @@ +####### +USB MSC +####### + +About +----- + +USB Mass Storage Class API. This class makes the device accessible as a mass storage device and allows you to transfer data between the host and the device. + +One of the examples for this mode is to flash the device by dropping the firmware binary like a flash memory device when connecting the ESP32 to the host computer. + +APIs +**** + +begin +^^^^^ + +This function is used to start the peripheral using the default MSC configuration. + +.. code-block:: arduino + + bool begin(uint32_t block_count, uint16_t block_size); + +Where: + +* ``block_count`` set the disk sector count. +* ``block_size`` set the disk sector size. + +This function will return ``true`` if the configuration was successful. + +end +^^^ + +This function will finish the peripheral as MSC and release all the allocated resources. After calling ``end`` you need to use ``begin`` again in order to initialize the USB MSC driver again. + +.. code-block:: arduino + + void end(); + +vendorID +^^^^^^^^ + +This function is used to define the vendor ID. + +.. code-block:: arduino + + void vendorID(const char * vid);//max 8 chars + +productID +^^^^^^^^^ + +This function is used to define the product ID. + +.. code-block:: arduino + + void productID(const char * pid);//max 16 chars + +productRevision +^^^^^^^^^^^^^^^ + +This function is used to define the product revision. + +.. code-block:: arduino + + void productRevision(const char * ver);//max 4 chars + +mediaPresent +^^^^^^^^^^^^ + +Set the ``mediaPresent`` configuration. + +.. code-block:: arduino + + void mediaPresent(bool media_present); + +onStartStop +^^^^^^^^^^^ + +Set the ``onStartStop`` callback function. + +.. code-block:: arduino + + void onStartStop(msc_start_stop_cb cb); + +onRead +^^^^^^ + +Set the ``onRead`` callback function. + +.. code-block:: arduino + + void onRead(msc_read_cb cb); + +onWrite +^^^^^^^ + +Set the ``onWrite`` callback function. + +.. code-block:: arduino + + void onWrite(msc_write_cb cb); + +Example Code +------------ + +Here is an example of how to use the USB MSC. + +FirmwareMSC +*********** + +.. literalinclude:: ../../../libraries/USB/examples/FirmwareMSC/FirmwareMSC.ino + :language: arduino + +.. _USB.org: https://www.usb.org/developers diff --git a/docs/source/esp-idf_component.rst b/docs/source/esp-idf_component.rst index d6f387375d5..3be9d85575d 100644 --- a/docs/source/esp-idf_component.rst +++ b/docs/source/esp-idf_component.rst @@ -5,15 +5,15 @@ Arduino as a ESP-IDF component ESP32 Arduino lib-builder ------------------------- -For a simplified method, see `lib-builder `_. +For a simplified method, see `lib-builder `_. Installation ------------ -.. note:: Latest Arduino Core ESP32 version is now compatible with [ESP-IDF v4.4](https://github.com/espressif/esp-idf/tree/release/v4.4). Please consider this compability when using Arduino as component in ESP-IDF. +.. note:: Latest Arduino Core ESP32 version is now compatible with `ESP-IDF v4.4 `_. Please consider this compability when using Arduino as component in ESP-IDF. - Download and install `ESP-IDF `_. -- Create blank idf project (from one of the examples). +- Create blank ESP-IDF project (use sample_project from /examples/get-started) or choose one of the examples. - In the project folder, create a new folder called `components` and clone this repository inside the new created folder. .. code-block:: bash @@ -26,10 +26,19 @@ Installation cd ../.. && \ idf.py menuconfig +Option 1. Using Arduino setup() and loop() +****************************************** - The `idf.py menuconfig` has some Arduino options. - - On `Autostart Arduino setup and loop on boot`. - - If you enable these options, your main.cpp should be formated like any other sketch. + - Turn on `Autostart Arduino setup and loop on boot`. + - In main folder rename file `main.c` to `main.cpp`. + - In main folder open file `CMakeList.txt` and change `main.c` to `main.cpp` as described below. + +.. code-block:: bash + + idf_component_register(SRCS "main.cpp" INCLUDE_DIRS ".") + +- Your main.cpp should be formated like any other sketch. .. code-block:: c @@ -45,14 +54,17 @@ Installation delay(1000); } -- Otherwise, you need to implement ```app_main()``` and call ```initArduino();``` in it. +Option 2. Using ESP-IDF appmain() +********************************* + +- You need to implement ``app_main()`` and call ``initArduino();`` in it. Keep in mind that setup() and loop() will not be called in this case. If you plan to base your code on examples provided in `examples `_, please make sure to move the app_main() function in main.cpp from the files in the example. .. code-block:: cpp - //file: main.cpp + //file: main.c or main.cpp #include "Arduino.h" extern "C" void app_main() @@ -69,7 +81,11 @@ If you plan to base your code on examples provided in `examples flash monitor``` will build, upload and open serial monitor to your board +Build, flash and monitor +************************ + +- For both options use command ``idf.py -p flash monitor`` +- It will build, upload and open serial monitor to your board. Logging To Serial ----------------- diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 434fad2dec8..91b66b343a3 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -37,7 +37,7 @@ SoC Stable Development Datasheet ESP32 Yes Yes `ESP32 Datasheet`_ ESP32-S2 Yes Yes `ESP32-S2 Datasheet`_ ESP32-C3 Yes Yes `ESP32-C3 Datasheet`_ -ESP32-S3 No No Not Available Yet +ESP32-S3 No No `ESP32-S3 Datasheet`_ ======== ====== =========== =================================== See `Boards `_ for more details about ESP32 development boards. @@ -122,6 +122,7 @@ Resources .. _ESP32 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf .. _ESP32-S2 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf .. _ESP32-C3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf +.. _ESP32-S3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf .. _Arduino.cc: https://www.arduino.cc/en/Main/Software .. _Arduino Reference: https://www.arduino.cc/reference/en/ .. _ESP32 Forum: https://esp32.com diff --git a/docs/source/installing.rst b/docs/source/installing.rst index 56511723eeb..59028fcbf1b 100644 --- a/docs/source/installing.rst +++ b/docs/source/installing.rst @@ -29,7 +29,7 @@ This is the preferred and easiest way to install Arduino-ESP32. .. note:: Starting with the Arduino IDE version 1.6.4, Arduino allows installation of third-party platform - packages using Boards Manager. We have packages available for Windows, macOS, and Linux (x86, amd64, armhf and arm64). + packages using Boards Manager. We have packages available for Windows, macOS, and Linux. To start the installation process using the Boards Managaer, follow these steps: @@ -61,10 +61,11 @@ To start the installation process using the Boards Managaer, follow these steps: Windows ------- -Steps to install Arduino ESP32 support on Windows: +.. warning:: Arduino ESP32 core v2.x.x cannot be used on Windows 8.x x86 (32 bits), Windows 7 or earlier. The Windows 32 bits OS is no longer supported by this toolchain. -.. note:: - Tested on Windows 10 32 and 64 bit machines. + The Arduino ESP32 v1.0.6 still works on WIN32. You might want to install python 3.8.x because it is the latest release supported by Windows 7. + +Steps to install Arduino ESP32 support on Windows: **Step 1** diff --git a/docs/source/libraries.rst b/docs/source/libraries.rst index 6275e603f2a..12dd8cfd37f 100644 --- a/docs/source/libraries.rst +++ b/docs/source/libraries.rst @@ -86,4 +86,5 @@ The Arduino ESP32 offers some unique APIs, described in this section: I2C RainMaker Reset Reason + USB Wi-Fi diff --git a/libraries/BLE/src/BLEHIDDevice.h b/libraries/BLE/src/BLEHIDDevice.h index fead92b730a..9770145f7e7 100644 --- a/libraries/BLE/src/BLEHIDDevice.h +++ b/libraries/BLE/src/BLEHIDDevice.h @@ -26,6 +26,7 @@ #define HID_CARD_READER 0x03C6 #define HID_DIGITAL_PEN 0x03C7 #define HID_BARCODE 0x03C8 +#define HID_BRAILLE_DISPLAY 0x03C9 class BLEHIDDevice { public: diff --git a/libraries/BluetoothSerial/src/BTAddress.cpp b/libraries/BluetoothSerial/src/BTAddress.cpp index 1ed416f2b24..7ef1eb1a85e 100644 --- a/libraries/BluetoothSerial/src/BTAddress.cpp +++ b/libraries/BluetoothSerial/src/BTAddress.cpp @@ -7,7 +7,7 @@ * Author: Thomas M. (ArcticSnowSky) */ #include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) +#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include "BTAddress.h" #include diff --git a/libraries/BluetoothSerial/src/BTAddress.h b/libraries/BluetoothSerial/src/BTAddress.h index e23d34593f1..6213d01fdf2 100644 --- a/libraries/BluetoothSerial/src/BTAddress.h +++ b/libraries/BluetoothSerial/src/BTAddress.h @@ -10,7 +10,7 @@ #ifndef COMPONENTS_CPP_UTILS_BTADDRESS_H_ #define COMPONENTS_CPP_UTILS_BTADDRESS_H_ #include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) +#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include // ESP32 BT #include diff --git a/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp b/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp index 78df93eab4a..c8f28e9c39e 100644 --- a/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp +++ b/libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp @@ -6,7 +6,7 @@ */ #include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) +#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) //#include diff --git a/libraries/BluetoothSerial/src/BTScanResultsSet.cpp b/libraries/BluetoothSerial/src/BTScanResultsSet.cpp index c4d00fa4204..79d23e463cd 100644 --- a/libraries/BluetoothSerial/src/BTScanResultsSet.cpp +++ b/libraries/BluetoothSerial/src/BTScanResultsSet.cpp @@ -6,7 +6,7 @@ */ #include "sdkconfig.h" -#if defined(CONFIG_BT_ENABLED) +#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED) #include diff --git a/libraries/ESP32/examples/AnalogOut/SigmaDelta/SigmaDelta.ino b/libraries/ESP32/examples/AnalogOut/SigmaDelta/SigmaDelta.ino index 4a5c012bb86..6520815a113 100644 --- a/libraries/ESP32/examples/AnalogOut/SigmaDelta/SigmaDelta.ino +++ b/libraries/ESP32/examples/AnalogOut/SigmaDelta/SigmaDelta.ino @@ -1,9 +1,7 @@ void setup() { - //setup channel 0 with frequency 312500 Hz - sigmaDeltaSetup(0, 312500); - //attach pin 18 to channel 0 - sigmaDeltaAttachPin(18,0); + //setup on pin 18, channel 0 with frequency 312500 Hz + sigmaDeltaSetup(18,0, 312500); //initialize channel 0 to off sigmaDeltaWrite(0, 0); } diff --git a/libraries/ESP32/examples/ArduinoStackSize/ArduinoStackSize.ino b/libraries/ESP32/examples/ArduinoStackSize/ArduinoStackSize.ino new file mode 100644 index 00000000000..73c42023591 --- /dev/null +++ b/libraries/ESP32/examples/ArduinoStackSize/ArduinoStackSize.ino @@ -0,0 +1,36 @@ +/* + ESP32 Arduino creates a task to run setup() and then to execute loop() continuously + This task can be found at https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/main.cpp + + By default "loopTask" will be created with a stack size of 8KB. + This should be plenty for most general sketches. + + There is a way to change the stack size of this task by using + SET_LOOP_TASK_STACK_SIZE(size); + It will bypass the default stack size of 8KB and allow the user to define a new size. + + It is recommend this value to be higher than 8KB, for instance 16KB. + This increasing may be necessary for the sketches that use deep recursion for instance. + + In this example, you can verify it by changing or just commenting out SET_LOOP_TASK_STACK_SIZE(); +*/ + + +// This sets Arduino Stack Size - comment this line to use default 8K stack size +SET_LOOP_TASK_STACK_SIZE(16*1024); // 16KB + +void setup() { + Serial.begin(115200); + + Serial.printf("Arduino Stack was set to %d bytes", getArduinoLoopTaskStackSize()); + + // Print unused stack for the task that is running setup() + Serial.printf("\nSetup() - Free Stack Space: %d", uxTaskGetStackHighWaterMark(NULL)); +} + +void loop() { + delay(1000); + + // Print unused stack for the task that is running loop() - the same as for setup() + Serial.printf("\nLoop() - Free Stack Space: %d", uxTaskGetStackHighWaterMark(NULL)); +} diff --git a/libraries/ESP32/examples/RMT/RMTCallback/RMTCallback.ino b/libraries/ESP32/examples/RMT/RMTCallback/RMTCallback.ino index 6a4c63bc7e5..7fd56d8a453 100644 --- a/libraries/ESP32/examples/RMT/RMTCallback/RMTCallback.ino +++ b/libraries/ESP32/examples/RMT/RMTCallback/RMTCallback.ino @@ -12,7 +12,7 @@ class MyProcessor { public: MyProcessor(uint8_t pin, float nanoTicks) { - assert((rmt_recv = rmtInit(21, false, RMT_MEM_192))); + assert((rmt_recv = rmtInit(21, RMT_RX_MODE, RMT_MEM_192))); realNanoTick = rmtSetTick(rmt_recv, nanoTicks); }; @@ -61,4 +61,4 @@ void loop() { Serial.printf("GPIO 4: %08x 5: %08x 6: %08x\n", mp1.val(), mp2.val(), mp3.val()); delay(500); -} +} \ No newline at end of file diff --git a/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino b/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino index 248aad3fa36..6b1ee2fa55d 100644 --- a/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino +++ b/libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino @@ -5,6 +5,17 @@ #include "esp32-hal.h" +#if CONFIG_IDF_TARGET_ESP32C3 +// ESP32 C3 has only 2 channels for RX and 2 for TX, thus MAX RMT_MEM is 128 +#define RMT_TX_PIN 4 +#define RMT_RX_PIN 5 +#define RMT_MEM_RX RMT_MEM_128 +#else +#define RMT_TX_PIN 18 +#define RMT_RX_PIN 21 +#define RMT_MEM_RX RMT_MEM_192 +#endif + rmt_data_t my_data[256]; rmt_data_t data[256]; @@ -18,18 +29,19 @@ void setup() Serial.begin(115200); events = xEventGroupCreate(); - if ((rmt_send = rmtInit(18, true, RMT_MEM_64)) == NULL) + if ((rmt_send = rmtInit(RMT_TX_PIN, RMT_TX_MODE, RMT_MEM_64)) == NULL) { Serial.println("init sender failed\n"); } - if ((rmt_recv = rmtInit(21, false, RMT_MEM_192)) == NULL) + if ((rmt_recv = rmtInit(RMT_RX_PIN, RMT_RX_MODE, RMT_MEM_RX)) == NULL) { Serial.println("init receiver failed\n"); } float realTick = rmtSetTick(rmt_send, 100); printf("real tick set to: %fns\n", realTick); - + // both will keep same tick + realTick = rmtSetTick(rmt_recv, 100); } void loop() diff --git a/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino b/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino index 39978d26dab..f87dd220513 100644 --- a/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino +++ b/libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino @@ -182,7 +182,7 @@ void setup() Serial.begin(115200); // Initialize the channel to capture up to 192 items - if ((rmt_recv = rmtInit(21, false, RMT_MEM_192)) == NULL) + if ((rmt_recv = rmtInit(21, RMT_RX_MODE, RMT_MEM_192)) == NULL) { Serial.println("init receiver failed\n"); } diff --git a/libraries/ESP32/examples/RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino b/libraries/ESP32/examples/RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino index 5067140fbd6..094e5f0fc1d 100644 --- a/libraries/ESP32/examples/RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino +++ b/libraries/ESP32/examples/RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino @@ -41,7 +41,7 @@ void setup() { Serial.begin(115200); - if ((rmt_send = rmtInit(18, true, RMT_MEM_64)) == NULL) + if ((rmt_send = rmtInit(18, RMT_TX_MODE, RMT_MEM_64)) == NULL) { Serial.println("init sender failed\n"); } diff --git a/libraries/Ethernet/src/ETH.cpp b/libraries/Ethernet/src/ETH.cpp index 33e86691b1d..851eb846170 100644 --- a/libraries/Ethernet/src/ETH.cpp +++ b/libraries/Ethernet/src/ETH.cpp @@ -282,7 +282,7 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ break; #endif case ETH_PHY_KSZ8081: -#if ESP_IDF_VERSION > ESP_IDF_VERSION_VAL(4,3,0) +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4,4,0) eth_phy = esp_eth_phy_new_ksz8081(&phy_config); #else log_e("unsupported ethernet type 'ETH_PHY_KSZ8081'"); diff --git a/libraries/HTTPClient/src/HTTPClient.cpp b/libraries/HTTPClient/src/HTTPClient.cpp index c99c633264e..a7bf13e89f5 100644 --- a/libraries/HTTPClient/src/HTTPClient.cpp +++ b/libraries/HTTPClient/src/HTTPClient.cpp @@ -200,6 +200,7 @@ bool HTTPClient::begin(String url, const char* CAcert) end(); } + clear(); _port = 443; if (!beginInternal(url, "https")) { return false; @@ -226,6 +227,7 @@ bool HTTPClient::begin(String url) end(); } + clear(); _port = 80; if (!beginInternal(url, "http")) { return begin(url, (const char*)NULL); @@ -243,7 +245,6 @@ bool HTTPClient::begin(String url) bool HTTPClient::beginInternal(String url, const char* expectedProtocol) { log_v("url: %s", url.c_str()); - clear(); // check for : (http: or https: int index = url.indexOf(':'); @@ -1212,8 +1213,8 @@ int HTTPClient::handleHeaderResponse() return HTTPC_ERROR_NOT_CONNECTED; } - clear(); - + _returnCode = 0; + _size = -1; _canReuse = _reuse; String transferEncoding; diff --git a/libraries/README.md b/libraries/README.md index ef9da07b5d0..e7c77efbad5 100644 --- a/libraries/README.md +++ b/libraries/README.md @@ -8,9 +8,6 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec ### AsyncUDP Asynchronous task driven UDP datagram client/server -### AzureIoT - Library to interact with Microsoft Azure IoT services - ### BLE Bluetooth Low Energy v4.2 client/server framework @@ -43,6 +40,9 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec ### ESPmDNS mDNS service advertising +### Ethernet + Ethernet networking + ### FFat FAT indexed filesystem on SPI flash @@ -55,6 +55,12 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec ### HTTPUpdate Download a firmware update from HTTPd and apply it using Update +### HTTPUpdateServer + Upload a firmware for the update from HTTPd + +### LittleFS + LittleFS (File System) + ### NetBIOS NetBIOS name advertiser @@ -85,6 +91,9 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec ### Update Sketch Update using ESP32 OTA functionality +### USB + Universal Serial Bus driver (device only) + ### WebServer A simple HTTP daemon @@ -95,4 +104,4 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec Arduino compatible WiFi client object using embedded encryption ### Wire - Arduino compatible I2C driver (master only) + Arduino compatible I2C driver diff --git a/libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32c3 b/libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32c3 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32s2 b/libraries/RainMaker/examples/RMakerSonoffDualR3/.skip.esp32s2 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/libraries/RainMaker/examples/RMakerSonoffDualR3/RMakerSonoffDualR3.ino b/libraries/RainMaker/examples/RMakerSonoffDualR3/RMakerSonoffDualR3.ino new file mode 100644 index 00000000000..37eda40134b --- /dev/null +++ b/libraries/RainMaker/examples/RMakerSonoffDualR3/RMakerSonoffDualR3.ino @@ -0,0 +1,193 @@ +//This example demonstrates the ESP RainMaker with a standard Switch device. +#include "RMaker.h" +#include "WiFi.h" +#include "WiFiProv.h" + +#define DEFAULT_POWER_MODE false +const char *service_name = "PROV_SONOFF_DUALR3"; +const char *pop = "123456"; + +// GPIO for push button +static uint8_t gpio_reset = 0; +// GPIO for switch +static uint8_t gpio_switch1 = 32; +static uint8_t gpio_switch2 = 33; +// GPIO for virtual device +static uint8_t gpio_relay1 = 27; +static uint8_t gpio_relay2 = 14; +/* Variable for reading pin status*/ +bool switch_state_ch1 = true; +bool switch_state_ch2 = true; +// GPIO for link status LED +static uint8_t gpio_led = 13; + +struct LightSwitch { + const uint8_t pin; + bool pressed; +}; + +// Define the light switches for channel 1 and 2 +LightSwitch switch_ch1 = {gpio_switch1, false}; +LightSwitch switch_ch2 = {gpio_switch2, false}; + +//The framework provides some standard device types like switch, lightbulb, fan, temperature sensor. +static Switch my_switch1("Switch_ch1", &gpio_relay1); +static Switch my_switch2("Switch_ch2", &gpio_relay2); + +void sysProvEvent(arduino_event_t *sys_event) +{ + switch (sys_event->event_id) { + case ARDUINO_EVENT_PROV_START: +#if CONFIG_IDF_TARGET_ESP32 + Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on BLE\n", service_name, pop); + printQR(service_name, pop, "ble"); +#else + Serial.printf("\nProvisioning Started with name \"%s\" and PoP \"%s\" on SoftAP\n", service_name, pop); + printQR(service_name, pop, "softap"); +#endif + break; + case ARDUINO_EVENT_WIFI_STA_CONNECTED: + Serial.printf("\nConnected to Wi-Fi!\n"); + digitalWrite(gpio_led, true); + break; + } +} + +void write_callback(Device *device, Param *param, const param_val_t val, void *priv_data, write_ctx_t *ctx) +{ + const char *device_name = device->getDeviceName(); + const char *param_name = param->getParamName(); + + if(strcmp(device_name, "Switch_ch1") == 0) { + + Serial.printf("Lightbulb = %s\n", val.val.b? "true" : "false"); + + if(strcmp(param_name, "Power") == 0) { + Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false", device_name, param_name); + switch_state_ch1 = val.val.b; + (switch_state_ch1 == false) ? digitalWrite(gpio_relay1, LOW) : digitalWrite(gpio_relay1, HIGH); + param->updateAndReport(val); + } + + } else if(strcmp(device_name, "Switch_ch2") == 0) { + + Serial.printf("Switch value = %s\n", val.val.b? "true" : "false"); + + if(strcmp(param_name, "Power") == 0) { + Serial.printf("Received value = %s for %s - %s\n", val.val.b? "true" : "false", device_name, param_name); + switch_state_ch2 = val.val.b; + (switch_state_ch2 == false) ? digitalWrite(gpio_relay2, LOW) : digitalWrite(gpio_relay2, HIGH); + param->updateAndReport(val); + } + + } + +} + +void ARDUINO_ISR_ATTR isr(void* arg) { + LightSwitch* s = static_cast(arg); + s->pressed = true; +} + +void setup() +{ + uint32_t chipId = 0; + + Serial.begin(115200); + + // Configure the input GPIOs + pinMode(gpio_reset, INPUT); + pinMode(switch_ch1.pin, INPUT_PULLUP); + attachInterruptArg(switch_ch1.pin, isr, &switch_ch1, CHANGE); + pinMode(switch_ch2.pin, INPUT_PULLUP); + attachInterruptArg(switch_ch2.pin, isr, &switch_ch2, CHANGE); + + // Set the Relays GPIOs as output mode + pinMode(gpio_relay1, OUTPUT); + pinMode(gpio_relay2, OUTPUT); + pinMode(gpio_led, OUTPUT); + // Write to the GPIOs the default state on booting + digitalWrite(gpio_relay1, DEFAULT_POWER_MODE); + digitalWrite(gpio_relay2, DEFAULT_POWER_MODE); + digitalWrite(gpio_led, false); + + Node my_node; + my_node = RMaker.initNode("Sonoff Dual R3"); + + //Standard switch device + my_switch1.addCb(write_callback); + my_switch2.addCb(write_callback); + + //Add switch device to the node + my_node.addDevice(my_switch1); + my_node.addDevice(my_switch2); + + //This is optional + RMaker.enableOTA(OTA_USING_PARAMS); + //If you want to enable scheduling, set time zone for your region using setTimeZone(). + //The list of available values are provided here https://rainmaker.espressif.com/docs/time-service.html + // RMaker.setTimeZone("Asia/Shanghai"); + // Alternatively, enable the Timezone service and let the phone apps set the appropriate timezone + RMaker.enableTZService(); + RMaker.enableSchedule(); + + //Service Name + for(int i=0; i<17; i=i+8) { + chipId |= ((ESP.getEfuseMac() >> (40 - i)) & 0xff) << i; + } + + Serial.printf("\nChip ID: %d Service Name: %s\n", chipId, service_name); + + Serial.printf("\nStarting ESP-RainMaker\n"); + RMaker.start(); + + WiFi.onEvent(sysProvEvent); +#if CONFIG_IDF_TARGET_ESP32 + WiFiProv.beginProvision(WIFI_PROV_SCHEME_BLE, WIFI_PROV_SCHEME_HANDLER_FREE_BTDM, WIFI_PROV_SECURITY_1, pop, service_name); +#else + WiFiProv.beginProvision(WIFI_PROV_SCHEME_SOFTAP, WIFI_PROV_SCHEME_HANDLER_NONE, WIFI_PROV_SECURITY_1, pop, service_name); +#endif +} + +void loop() +{ + + if (switch_ch1.pressed) { + Serial.printf("Switch 1 has been changed\n"); + switch_ch1.pressed = false; + // Toggle switch 1 device state + switch_state_ch1 = !switch_state_ch1; + Serial.printf("Toggle State to %s.\n", switch_state_ch1 ? "true" : "false"); + my_switch1.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME, switch_state_ch1); + (switch_state_ch1 == false) ? digitalWrite(gpio_relay1, LOW) : digitalWrite(gpio_relay1, HIGH); + } else if (switch_ch2.pressed) { + Serial.printf("Switch 2 has been changed\n"); + switch_ch2.pressed = false; + // Toggle switch 2 device state + switch_state_ch2 = !switch_state_ch2; + Serial.printf("Toggle State to %s.\n", switch_state_ch2 ? "true" : "false"); + my_switch2.updateAndReportParam(ESP_RMAKER_DEF_POWER_NAME, switch_state_ch2); + (switch_state_ch2 == false) ? digitalWrite(gpio_relay2, LOW) : digitalWrite(gpio_relay2, HIGH); + } + + // Read GPIO0 (external button to reset device + if(digitalRead(gpio_reset) == LOW) { //Push button pressed + Serial.printf("Reset Button Pressed!\n"); + // Key debounce handling + delay(100); + int startTime = millis(); + while(digitalRead(gpio_reset) == LOW) delay(50); + int endTime = millis(); + + if ((endTime - startTime) > 10000) { + // If key pressed for more than 10secs, reset all + Serial.printf("Reset to factory.\n"); + RMakerFactoryReset(2); + } else if ((endTime - startTime) > 3000) { + Serial.printf("Reset Wi-Fi.\n"); + // If key pressed for more than 3secs, but less than 10, reset Wi-Fi + RMakerWiFiReset(2); + } + } + delay(100); +} diff --git a/libraries/SD/src/sd_diskio.cpp b/libraries/SD/src/sd_diskio.cpp index 0e1252fdfec..e69050a74f1 100644 --- a/libraries/SD/src/sd_diskio.cpp +++ b/libraries/SD/src/sd_diskio.cpp @@ -609,6 +609,11 @@ DSTATUS ff_sd_initialize(uint8_t pdrv) DSTATUS ff_sd_status(uint8_t pdrv) { + if(sdCommand(pdrv, SEND_STATUS, 0, NULL) == 0xFF) + { + log_e("Check status failed"); + return STA_NOINIT; + } return s_cards[pdrv]->status; } diff --git a/libraries/WiFi/src/WiFiSTA.cpp b/libraries/WiFi/src/WiFiSTA.cpp index 00096bde0ee..dd468823607 100644 --- a/libraries/WiFi/src/WiFiSTA.cpp +++ b/libraries/WiFi/src/WiFiSTA.cpp @@ -98,7 +98,7 @@ static void wifi_sta_config(wifi_config_t * wifi_config, const char * ssid=NULL, if(ssid != NULL && ssid[0] != 0){ _wifi_strncpy((char*)wifi_config->sta.ssid, ssid, 32); if(password != NULL && password[0] != 0){ - wifi_config->sta.threshold.authmode = WIFI_AUTH_WEP; + wifi_config->sta.threshold.authmode = WIFI_AUTH_WPA2_PSK; _wifi_strncpy((char*)wifi_config->sta.password, password, 64); } if(bssid != NULL){ @@ -176,15 +176,19 @@ wl_status_t WiFiSTAClass::begin(const char* ssid, const char *passphrase, int32_ wifi_config_t conf; memset(&conf, 0, sizeof(wifi_config_t)); _wifi_strncpy(reinterpret_cast(conf.sta.ssid), ssid, 32); - conf.sta.scan_method = WIFI_ALL_CHANNEL_SCAN; //force full scan to be able to choose the nearest / strongest AP if(passphrase) { _wifi_strncpy(reinterpret_cast(conf.sta.password), passphrase, 64); } - wifi_config_t current_conf; - wifi_sta_config(&conf, ssid, passphrase, bssid, channel); + if(channel == 0) { + // If no specific channel specified, then do an slower WIFI_ALL_CHANNEL_SCAN + wifi_sta_config(&conf, ssid, passphrase, bssid, channel, WIFI_ALL_CHANNEL_SCAN); + } + else + wifi_sta_config(&conf, ssid, passphrase, bssid, channel, WIFI_FAST_SCAN); + wifi_config_t current_conf; if(esp_wifi_get_config((wifi_interface_t)ESP_IF_WIFI_STA, ¤t_conf) != ESP_OK){ log_e("get current config failed!"); return WL_CONNECT_FAILED; diff --git a/libraries/WiFiClientSecure/src/ssl_client.cpp b/libraries/WiFiClientSecure/src/ssl_client.cpp index c910206b3c9..38783aee2e4 100644 --- a/libraries/WiFiClientSecure/src/ssl_client.cpp +++ b/libraries/WiFiClientSecure/src/ssl_client.cpp @@ -45,6 +45,8 @@ static int _handle_error(int err, const char * function, int line) void ssl_init(sslclient_context *ssl_client) { + // reset embedded pointers to zero + memset(ssl_client, 0, sizeof(sslclient_context)); mbedtls_ssl_init(&ssl_client->ssl_ctx); mbedtls_ssl_config_init(&ssl_client->ssl_conf); mbedtls_ctr_drbg_init(&ssl_client->drbg_ctx); @@ -232,6 +234,7 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p ret = mbedtls_pk_parse_key(&ssl_client->client_key, (const unsigned char *)cli_key, strlen(cli_key) + 1, NULL, 0); if (ret != 0) { + mbedtls_x509_crt_free(&ssl_client->client_cert); // cert+key are free'd in pair return handle_error(ret); } @@ -243,7 +246,7 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p // Hostname set here should match CN in server certificate if((ret = mbedtls_ssl_set_hostname(&ssl_client->ssl_ctx, host)) != 0){ return handle_error(ret); - } + } mbedtls_ssl_conf_rng(&ssl_client->ssl_conf, mbedtls_ctr_drbg_random, &ssl_client->drbg_ctx); @@ -260,8 +263,8 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p return handle_error(ret); } if((millis()-handshake_start_time)>ssl_client->handshake_timeout) - return -1; - vTaskDelay(2);//2 ticks + return -1; + vTaskDelay(2);//2 ticks } @@ -280,7 +283,6 @@ int start_ssl_client(sslclient_context *ssl_client, const char *host, uint32_t p memset(buf, 0, sizeof(buf)); mbedtls_x509_crt_verify_info(buf, sizeof(buf), " ! ", flags); log_e("Failed to verify peer certificate! verification info: %s", buf); - stop_ssl_socket(ssl_client, rootCABuff, cli_cert, cli_key); //It's not safe continue. return handle_error(ret); } else { log_v("Certificate verified."); @@ -313,10 +315,20 @@ void stop_ssl_socket(sslclient_context *ssl_client, const char *rootCABuff, cons ssl_client->socket = -1; } + // avoid memory leak if ssl connection attempt failed + if (ssl_client->ssl_conf.ca_chain != NULL) { + mbedtls_x509_crt_free(&ssl_client->ca_cert); + } + if (ssl_client->ssl_conf.key_cert != NULL) { + mbedtls_x509_crt_free(&ssl_client->client_cert); + mbedtls_pk_free(&ssl_client->client_key); + } mbedtls_ssl_free(&ssl_client->ssl_ctx); mbedtls_ssl_config_free(&ssl_client->ssl_conf); mbedtls_ctr_drbg_free(&ssl_client->drbg_ctx); mbedtls_entropy_free(&ssl_client->entropy_ctx); + // reset embedded pointers to zero + memset(ssl_client, 0, sizeof(sslclient_context)); } diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp index 68d82833be4..bc06ba5483a 100644 --- a/libraries/Wire/src/Wire.cpp +++ b/libraries/Wire/src/Wire.cpp @@ -354,7 +354,7 @@ uint8_t TwoWire::endTransmission(bool sendStop) return 4; } -uint8_t TwoWire::requestFrom(uint16_t address, uint8_t size, bool sendStop) +size_t TwoWire::requestFrom(uint16_t address, size_t size, bool sendStop) { if(is_slave){ log_e("Bus is in Slave Mode"); @@ -445,42 +445,47 @@ void TwoWire::flush(void) //i2cFlush(num); // cleanup } -uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop) +size_t TwoWire::requestFrom(uint8_t address, size_t len, bool sendStop) { - return requestFrom(static_cast(address), static_cast(quantity), static_cast(sendStop)); + return requestFrom(static_cast(address), static_cast(len), static_cast(sendStop)); +} + +uint8_t TwoWire::requestFrom(uint8_t address, uint8_t len, uint8_t sendStop) +{ + return requestFrom(static_cast(address), static_cast(len), static_cast(sendStop)); } -uint8_t TwoWire::requestFrom(uint16_t address, uint8_t quantity, uint8_t sendStop) +uint8_t TwoWire::requestFrom(uint16_t address, uint8_t len, uint8_t sendStop) { - return requestFrom(address, static_cast(quantity), static_cast(sendStop)); + return requestFrom(address, static_cast(len), static_cast(sendStop)); } /* Added to match the Arduino function definition: https://github.com/arduino/ArduinoCore-API/blob/173e8eadced2ad32eeb93bcbd5c49f8d6a055ea6/api/HardwareI2C.h#L39 * See: https://github.com/arduino-libraries/ArduinoECCX08/issues/25 */ -size_t TwoWire::requestFrom(uint8_t address, size_t len, bool stopBit) +uint8_t TwoWire::requestFrom(uint16_t address, uint8_t len, bool stopBit) { - return requestFrom((uint16_t)address, (uint8_t)len, stopBit); + return requestFrom((uint16_t)address, (size_t)len, stopBit); } -uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity) +uint8_t TwoWire::requestFrom(uint8_t address, uint8_t len) { - return requestFrom(static_cast(address), static_cast(quantity), true); + return requestFrom(static_cast(address), static_cast(len), true); } -uint8_t TwoWire::requestFrom(uint16_t address, uint8_t quantity) +uint8_t TwoWire::requestFrom(uint16_t address, uint8_t len) { - return requestFrom(address, static_cast(quantity), true); + return requestFrom(address, static_cast(len), true); } -uint8_t TwoWire::requestFrom(int address, int quantity) +uint8_t TwoWire::requestFrom(int address, int len) { - return requestFrom(static_cast(address), static_cast(quantity), true); + return requestFrom(static_cast(address), static_cast(len), true); } -uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop) +uint8_t TwoWire::requestFrom(int address, int len, int sendStop) { - return static_cast(requestFrom(static_cast(address), static_cast(quantity), static_cast(sendStop))); + return static_cast(requestFrom(static_cast(address), static_cast(len), static_cast(sendStop))); } void TwoWire::beginTransmission(int address) diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h index da527b58ba0..ca048bb16c4 100644 --- a/libraries/Wire/src/Wire.h +++ b/libraries/Wire/src/Wire.h @@ -93,6 +93,7 @@ class TwoWire: public Stream uint8_t endTransmission(bool sendStop); uint8_t endTransmission(void); + size_t requestFrom(uint16_t address, size_t size, bool sendStop); uint8_t requestFrom(uint16_t address, uint8_t size, bool sendStop); uint8_t requestFrom(uint16_t address, uint8_t size, uint8_t sendStop); size_t requestFrom(uint8_t address, size_t len, bool stopBit); diff --git a/package.json b/package.json old mode 100755 new mode 100644 diff --git a/platform.txt b/platform.txt index a38a4b175d0..2a8a3283b1d 100644 --- a/platform.txt +++ b/platform.txt @@ -23,12 +23,12 @@ compiler.prefix={build.tarch}-{build.target}-elf- # # ESP32 Support Start # -compiler.cpreprocessor.flags.esp32=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-dev-3569-g6a7d83af19-dirty" -DESP_PLATFORM "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32" "-I{compiler.sdk.path}/include/soc/esp32/include" "-I{compiler.sdk.path}/include/hal/esp32/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32" "-I{compiler.sdk.path}/include/esp_rom/esp32" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/esp32/include" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32/include" "-I{compiler.sdk.path}/include/bt/common/api/include/api" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/blufi/include" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/button/button/include" "-I{compiler.sdk.path}/include/json_parser" "-I{compiler.sdk.path}/include/json_parser/jsmn/include" "-I{compiler.sdk.path}/include/json_generator" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/esp-face/include" "-I{compiler.sdk.path}/include/esp-face/include/tool" "-I{compiler.sdk.path}/include/esp-face/include/typedef" "-I{compiler.sdk.path}/include/esp-face/include/image" "-I{compiler.sdk.path}/include/esp-face/include/math" "-I{compiler.sdk.path}/include/esp-face/include/nn" "-I{compiler.sdk.path}/include/esp-face/include/layer" "-I{compiler.sdk.path}/include/esp-face/include/detect" "-I{compiler.sdk.path}/include/esp-face/include/model_zoo" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" +compiler.cpreprocessor.flags.esp32=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-beta1-189-ga79dc75f0a" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32" "-I{compiler.sdk.path}/include/soc/esp32/include" "-I{compiler.sdk.path}/include/hal/esp32/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32" "-I{compiler.sdk.path}/include/esp_rom/esp32" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/esp32/include" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32/include" "-I{compiler.sdk.path}/include/bt/common/api/include/api" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/blufi/include" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/button/button/include" "-I{compiler.sdk.path}/include/json_parser" "-I{compiler.sdk.path}/include/json_parser/jsmn/include" "-I{compiler.sdk.path}/include/json_generator" "-I{compiler.sdk.path}/include/esp_schedule/include" "-I{compiler.sdk.path}/include/esp_rainmaker/include" "-I{compiler.sdk.path}/include/qrcode/include" "-I{compiler.sdk.path}/include/ws2812_led" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/esp-face/include" "-I{compiler.sdk.path}/include/esp-face/include/tool" "-I{compiler.sdk.path}/include/esp-face/include/typedef" "-I{compiler.sdk.path}/include/esp-face/include/image" "-I{compiler.sdk.path}/include/esp-face/include/math" "-I{compiler.sdk.path}/include/esp-face/include/nn" "-I{compiler.sdk.path}/include/esp-face/include/layer" "-I{compiler.sdk.path}/include/esp-face/include/detect" "-I{compiler.sdk.path}/include/esp-face/include/model_zoo" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" compiler.c.elf.libs.esp32=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lperfmon -lspiffs -lulp -lwifi_provisioning -lbutton -ljson_parser -ljson_generator -lesp_schedule -lesp_rainmaker -lqrcode -lws2812_led -lesp-dsp -lesp32-camera -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_lcd -lesp_local_ctrl -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lperfmon -lesp_adc_cal -lesp_hid -lfatfs -lwear_levelling -lopenssl -lspiffs -lesp_rainmaker -lmqtt -lwifi_provisioning -lprotocomm -lbt -lbtdm_app -lprotobuf-c -lmdns -ljson -ljson_parser -ljson_generator -lesp_schedule -lqrcode -lcat_face_detect -lhuman_face_detect -lcolor_detect -lmfn -ldl -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lrtc -lesp_phy -lphy -lrtc -lesp_phy -lphy -lrtc -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc compiler.c.flags.esp32=-mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu99 -Wno-old-style-declaration -MMD -c compiler.cpp.flags.esp32=-mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fexceptions -fno-rtti -MMD -c compiler.S.flags.esp32=-ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -x assembler-with-cpp -MMD -c -compiler.c.elf.flags.esp32=-T esp32.rom.redefined.ld -T memory.ld -T sections.ld -T esp32.rom.ld -T esp32.rom.api.ld -T esp32.rom.libgcc.ld -T esp32.rom.newlib-data.ld -T esp32.rom.syscalls.ld -T esp32.peripherals.ld -mlongcalls -Wno-frame-address -Wl,--cref -Wl,--gc-sections -fno-rtti -fno-lto -u ld_include_hli_vectors_bt -u _Z5setupv -u _Z4loopv -Wl,--wrap=mbedtls_mpi_exp_mod -u esp_app_desc -u pthread_include_pthread_impl -u pthread_include_pthread_cond_impl -u pthread_include_pthread_local_storage_impl -u ld_include_highint_hdl -u start_app -u start_app_other_cores -u __ubsan_include -Wl,--wrap=longjmp -u __assert_func -u vfs_include_syscalls_impl -Wl,--undefined=uxTopUsedPriority -u app_main -u newlib_include_heap_impl -u newlib_include_syscalls_impl -u newlib_include_pthread_impl -u newlib_include_assert_impl -u __cxa_guard_dummy +compiler.c.elf.flags.esp32=-T esp32.rom.redefined.ld -T memory.ld -T sections.ld -T esp32.rom.ld -T esp32.rom.api.ld -T esp32.rom.libgcc.ld -T esp32.rom.newlib-data.ld -T esp32.rom.syscalls.ld -T esp32.peripherals.ld -mlongcalls -Wno-frame-address -Wl,--cref -Wl,--gc-sections -fno-rtti -fno-lto -u ld_include_hli_vectors_bt -u _Z5setupv -u _Z4loopv -u esp_app_desc -u pthread_include_pthread_impl -u pthread_include_pthread_cond_impl -u pthread_include_pthread_local_storage_impl -u pthread_include_pthread_rwlock_impl -u ld_include_highint_hdl -u start_app -u start_app_other_cores -u __ubsan_include -Wl,--wrap=longjmp -u __assert_func -u vfs_include_syscalls_impl -Wl,--undefined=uxTopUsedPriority -u app_main -u newlib_include_heap_impl -u newlib_include_syscalls_impl -u newlib_include_pthread_impl -u newlib_include_assert_impl -u __cxa_guard_dummy compiler.ar.flags.esp32=cr build.extra_flags.esp32=-DARDUINO_USB_CDC_ON_BOOT=0 # @@ -38,12 +38,12 @@ build.extra_flags.esp32=-DARDUINO_USB_CDC_ON_BOOT=0 # # ESP32S2 Support Start # -compiler.cpreprocessor.flags.esp32s2=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-dev-3569-g6a7d83af19-dirty" -DESP_PLATFORM "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32s2" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32s2" "-I{compiler.sdk.path}/include/soc/esp32s2/include" "-I{compiler.sdk.path}/include/hal/esp32s2/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32s2" "-I{compiler.sdk.path}/include/esp_rom/esp32s2" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32s2/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32s2/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32s2/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32s2/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32s2" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32s2" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/usb/include" "-I{compiler.sdk.path}/include/touch_element/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/freertos/include/freertos" "-I{compiler.sdk.path}/include/arduino_tinyusb/tinyusb/src" "-I{compiler.sdk.path}/include/arduino_tinyusb/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/esp-face/include" "-I{compiler.sdk.path}/include/esp-face/include/tool" "-I{compiler.sdk.path}/include/esp-face/include/typedef" "-I{compiler.sdk.path}/include/esp-face/include/image" "-I{compiler.sdk.path}/include/esp-face/include/math" "-I{compiler.sdk.path}/include/esp-face/include/nn" "-I{compiler.sdk.path}/include/esp-face/include/layer" "-I{compiler.sdk.path}/include/esp-face/include/detect" "-I{compiler.sdk.path}/include/esp-face/include/model_zoo" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" +compiler.cpreprocessor.flags.esp32s2=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-beta1-189-ga79dc75f0a" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/xtensa/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32s2" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32s2/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32s2" "-I{compiler.sdk.path}/include/soc/esp32s2/include" "-I{compiler.sdk.path}/include/hal/esp32s2/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32s2" "-I{compiler.sdk.path}/include/esp_rom/esp32s2" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/xtensa/include" "-I{compiler.sdk.path}/include/xtensa/esp32s2/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32s2/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32s2/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32s2/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/xtensa" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32s2" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/xtensa" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32s2" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/perfmon/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/usb/include" "-I{compiler.sdk.path}/include/touch_element/include" "-I{compiler.sdk.path}/include/ulp/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/freertos/include/freertos" "-I{compiler.sdk.path}/include/arduino_tinyusb/tinyusb/src" "-I{compiler.sdk.path}/include/arduino_tinyusb/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dotprod/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/support/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/hann/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_harris/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/blackman_nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/nuttall/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/windows/flat_top/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/iir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fir/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/add/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sub/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mul/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/addc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/mulc/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/math/sqrt/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/matrix/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/fft/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/dct/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/conv/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/common/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf/include" "-I{compiler.sdk.path}/include/esp-dsp/modules/kalman/ekf_imu13states/include" "-I{compiler.sdk.path}/include/esp-face/include" "-I{compiler.sdk.path}/include/esp-face/include/tool" "-I{compiler.sdk.path}/include/esp-face/include/typedef" "-I{compiler.sdk.path}/include/esp-face/include/image" "-I{compiler.sdk.path}/include/esp-face/include/math" "-I{compiler.sdk.path}/include/esp-face/include/nn" "-I{compiler.sdk.path}/include/esp-face/include/layer" "-I{compiler.sdk.path}/include/esp-face/include/detect" "-I{compiler.sdk.path}/include/esp-face/include/model_zoo" "-I{compiler.sdk.path}/include/esp32-camera/driver/include" "-I{compiler.sdk.path}/include/esp32-camera/conversions/include" "-I{compiler.sdk.path}/include/fb_gfx/include" compiler.c.elf.libs.esp32s2=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lcbor -lunity -lcmock -lcoap -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lperfmon -lspiffs -lusb -ltouch_element -lulp -lwifi_provisioning -lesp-dsp -lesp32-camera -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_lcd -lesp_local_ctrl -lesp_https_server -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lmqtt -lperfmon -lusb -ltouch_element -lesp_adc_cal -lesp_hid -lfatfs -lwear_levelling -lopenssl -lspiffs -lwifi_provisioning -lprotocomm -lprotobuf-c -lmdns -ljson -larduino_tinyusb -lcat_face_detect -lhuman_face_detect -lcolor_detect -lmfn -ldl -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lxtensa -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lulp -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lesp_phy -lphy -lesp_phy -lphy -lxt_hal -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc compiler.c.flags.esp32s2=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu99 -Wno-old-style-declaration -MMD -c compiler.cpp.flags.esp32s2=-mlongcalls -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fexceptions -fno-rtti -MMD -c compiler.S.flags.esp32s2=-ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -Wwrite-strings -fstack-protector -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -x assembler-with-cpp -MMD -c -compiler.c.elf.flags.esp32s2=-T memory.ld -T sections.ld -T esp32s2.rom.ld -T esp32s2.rom.api.ld -T esp32s2.rom.libgcc.ld -T esp32s2.rom.newlib-funcs.ld -T esp32s2.rom.newlib-data.ld -T esp32s2.rom.spiflash.ld -T esp32s2.peripherals.ld -mlongcalls -Wl,--cref -Wl,--gc-sections -fno-rtti -fno-lto -u _Z5setupv -u _Z4loopv -u esp_app_desc -u pthread_include_pthread_impl -u pthread_include_pthread_cond_impl -u pthread_include_pthread_local_storage_impl -u ld_include_highint_hdl -u start_app -u __ubsan_include -Wl,--wrap=longjmp -u __assert_func -u vfs_include_syscalls_impl -Wl,--undefined=uxTopUsedPriority -u app_main -u newlib_include_heap_impl -u newlib_include_syscalls_impl -u newlib_include_pthread_impl -u newlib_include_assert_impl -u __cxa_guard_dummy +compiler.c.elf.flags.esp32s2=-T memory.ld -T sections.ld -T esp32s2.rom.ld -T esp32s2.rom.api.ld -T esp32s2.rom.libgcc.ld -T esp32s2.rom.newlib-funcs.ld -T esp32s2.rom.newlib-data.ld -T esp32s2.rom.spiflash.ld -T esp32s2.peripherals.ld -mlongcalls -Wl,--cref -Wl,--gc-sections -fno-rtti -fno-lto -u _Z5setupv -u _Z4loopv -u esp_app_desc -u pthread_include_pthread_impl -u pthread_include_pthread_cond_impl -u pthread_include_pthread_local_storage_impl -u pthread_include_pthread_rwlock_impl -u ld_include_highint_hdl -u start_app -u __ubsan_include -Wl,--wrap=longjmp -u __assert_func -u vfs_include_syscalls_impl -Wl,--undefined=uxTopUsedPriority -u app_main -u newlib_include_heap_impl -u newlib_include_syscalls_impl -u newlib_include_pthread_impl -u newlib_include_assert_impl -u __cxa_guard_dummy compiler.ar.flags.esp32s2=cr build.extra_flags.esp32s2=-DARDUINO_USB_CDC_ON_BOOT={build.cdc_on_boot} -DARDUINO_USB_MSC_ON_BOOT={build.msc_on_boot} -DARDUINO_USB_DFU_ON_BOOT={build.dfu_on_boot} # @@ -53,12 +53,12 @@ build.extra_flags.esp32s2=-DARDUINO_USB_CDC_ON_BOOT={build.cdc_on_boot} -DARDUIN # # ESP32C3 Support Start # -compiler.cpreprocessor.flags.esp32c3=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-dev-3569-g6a7d83af19-dirty" -DESP_PLATFORM "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/riscv/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32c3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32c3" "-I{compiler.sdk.path}/include/soc/esp32c3/include" "-I{compiler.sdk.path}/include/hal/esp32c3/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32c3" "-I{compiler.sdk.path}/include/esp_rom/esp32c3" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/include/riscv" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/riscv/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32c3/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32c3/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32c3/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/riscv" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32c3" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/riscv" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32c3/include" "-I{compiler.sdk.path}/include/bt/common/api/include/api" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/blufi/include" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32c3" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-face/include" "-I{compiler.sdk.path}/include/esp-face/include/tool" "-I{compiler.sdk.path}/include/esp-face/include/typedef" "-I{compiler.sdk.path}/include/esp-face/include/image" "-I{compiler.sdk.path}/include/esp-face/include/math" "-I{compiler.sdk.path}/include/esp-face/include/nn" "-I{compiler.sdk.path}/include/esp-face/include/layer" "-I{compiler.sdk.path}/include/esp-face/include/detect" "-I{compiler.sdk.path}/include/esp-face/include/model_zoo" "-I{compiler.sdk.path}/include/fb_gfx/include" +compiler.cpreprocessor.flags.esp32c3=-DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE="mbedtls/esp_config.h" -DUNITY_INCLUDE_CONFIG_H -DWITH_POSIX -D_GNU_SOURCE -DIDF_VER="v4.4-beta1-189-ga79dc75f0a" -DESP_PLATFORM -D_POSIX_READER_WRITER_LOCKS "-I{compiler.sdk.path}/include/config" "-I{compiler.sdk.path}/include/newlib/platform_include" "-I{compiler.sdk.path}/include/freertos/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions/freertos" "-I{compiler.sdk.path}/include/freertos/port/riscv/include" "-I{compiler.sdk.path}/include/freertos/include/esp_additions" "-I{compiler.sdk.path}/include/esp_hw_support/include" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc" "-I{compiler.sdk.path}/include/esp_hw_support/include/soc/esp32c3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3" "-I{compiler.sdk.path}/include/esp_hw_support/port/esp32c3/private_include" "-I{compiler.sdk.path}/include/heap/include" "-I{compiler.sdk.path}/include/log/include" "-I{compiler.sdk.path}/include/lwip/include/apps" "-I{compiler.sdk.path}/include/lwip/include/apps/sntp" "-I{compiler.sdk.path}/include/lwip/lwip/src/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include" "-I{compiler.sdk.path}/include/lwip/port/esp32/include/arch" "-I{compiler.sdk.path}/include/soc/include" "-I{compiler.sdk.path}/include/soc/esp32c3" "-I{compiler.sdk.path}/include/soc/esp32c3/include" "-I{compiler.sdk.path}/include/hal/esp32c3/include" "-I{compiler.sdk.path}/include/hal/include" "-I{compiler.sdk.path}/include/hal/platform_port/include" "-I{compiler.sdk.path}/include/esp_rom/include" "-I{compiler.sdk.path}/include/esp_rom/include/esp32c3" "-I{compiler.sdk.path}/include/esp_rom/esp32c3" "-I{compiler.sdk.path}/include/esp_common/include" "-I{compiler.sdk.path}/include/esp_system/include" "-I{compiler.sdk.path}/include/esp_system/port/soc" "-I{compiler.sdk.path}/include/esp_system/port/include/riscv" "-I{compiler.sdk.path}/include/esp_system/port/public_compat" "-I{compiler.sdk.path}/include/riscv/include" "-I{compiler.sdk.path}/include/driver/include" "-I{compiler.sdk.path}/include/driver/esp32c3/include" "-I{compiler.sdk.path}/include/esp_pm/include" "-I{compiler.sdk.path}/include/esp_ringbuf/include" "-I{compiler.sdk.path}/include/efuse/include" "-I{compiler.sdk.path}/include/efuse/esp32c3/include" "-I{compiler.sdk.path}/include/vfs/include" "-I{compiler.sdk.path}/include/esp_wifi/include" "-I{compiler.sdk.path}/include/esp_event/include" "-I{compiler.sdk.path}/include/esp_netif/include" "-I{compiler.sdk.path}/include/esp_eth/include" "-I{compiler.sdk.path}/include/tcpip_adapter/include" "-I{compiler.sdk.path}/include/esp_phy/include" "-I{compiler.sdk.path}/include/esp_phy/esp32c3/include" "-I{compiler.sdk.path}/include/esp_ipc/include" "-I{compiler.sdk.path}/include/app_trace/include" "-I{compiler.sdk.path}/include/esp_timer/include" "-I{compiler.sdk.path}/include/mbedtls/port/include" "-I{compiler.sdk.path}/include/mbedtls/mbedtls/include" "-I{compiler.sdk.path}/include/mbedtls/esp_crt_bundle/include" "-I{compiler.sdk.path}/include/app_update/include" "-I{compiler.sdk.path}/include/spi_flash/include" "-I{compiler.sdk.path}/include/bootloader_support/include" "-I{compiler.sdk.path}/include/nvs_flash/include" "-I{compiler.sdk.path}/include/pthread/include" "-I{compiler.sdk.path}/include/esp_gdbstub/include" "-I{compiler.sdk.path}/include/esp_gdbstub/riscv" "-I{compiler.sdk.path}/include/esp_gdbstub/esp32c3" "-I{compiler.sdk.path}/include/espcoredump/include" "-I{compiler.sdk.path}/include/espcoredump/include/port/riscv" "-I{compiler.sdk.path}/include/wpa_supplicant/include" "-I{compiler.sdk.path}/include/wpa_supplicant/port/include" "-I{compiler.sdk.path}/include/wpa_supplicant/esp_supplicant/include" "-I{compiler.sdk.path}/include/ieee802154/include" "-I{compiler.sdk.path}/include/console" "-I{compiler.sdk.path}/include/asio/asio/asio/include" "-I{compiler.sdk.path}/include/asio/port/include" "-I{compiler.sdk.path}/include/bt/common/osi/include" "-I{compiler.sdk.path}/include/bt/include/esp32c3/include" "-I{compiler.sdk.path}/include/bt/common/api/include/api" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/blufi/include" "-I{compiler.sdk.path}/include/bt/common/btc/profile/esp/include" "-I{compiler.sdk.path}/include/bt/host/bluedroid/api/include/api" "-I{compiler.sdk.path}/include/cbor/port/include" "-I{compiler.sdk.path}/include/unity/include" "-I{compiler.sdk.path}/include/unity/unity/src" "-I{compiler.sdk.path}/include/cmock/CMock/src" "-I{compiler.sdk.path}/include/coap/port/include" "-I{compiler.sdk.path}/include/coap/libcoap/include" "-I{compiler.sdk.path}/include/nghttp/port/include" "-I{compiler.sdk.path}/include/nghttp/nghttp2/lib/includes" "-I{compiler.sdk.path}/include/esp-tls" "-I{compiler.sdk.path}/include/esp-tls/esp-tls-crypto" "-I{compiler.sdk.path}/include/esp_adc_cal/include" "-I{compiler.sdk.path}/include/esp_hid/include" "-I{compiler.sdk.path}/include/tcp_transport/include" "-I{compiler.sdk.path}/include/esp_http_client/include" "-I{compiler.sdk.path}/include/esp_http_server/include" "-I{compiler.sdk.path}/include/esp_https_ota/include" "-I{compiler.sdk.path}/include/esp_https_server/include" "-I{compiler.sdk.path}/include/esp_lcd/include" "-I{compiler.sdk.path}/include/esp_lcd/interface" "-I{compiler.sdk.path}/include/protobuf-c/protobuf-c" "-I{compiler.sdk.path}/include/protocomm/include/common" "-I{compiler.sdk.path}/include/protocomm/include/security" "-I{compiler.sdk.path}/include/protocomm/include/transports" "-I{compiler.sdk.path}/include/mdns/include" "-I{compiler.sdk.path}/include/esp_local_ctrl/include" "-I{compiler.sdk.path}/include/sdmmc/include" "-I{compiler.sdk.path}/include/esp_serial_slave_link/include" "-I{compiler.sdk.path}/include/esp_websocket_client/include" "-I{compiler.sdk.path}/include/expat/expat/expat/lib" "-I{compiler.sdk.path}/include/expat/port/include" "-I{compiler.sdk.path}/include/wear_levelling/include" "-I{compiler.sdk.path}/include/fatfs/diskio" "-I{compiler.sdk.path}/include/fatfs/vfs" "-I{compiler.sdk.path}/include/fatfs/src" "-I{compiler.sdk.path}/include/freemodbus/common/include" "-I{compiler.sdk.path}/include/idf_test/include" "-I{compiler.sdk.path}/include/idf_test/include/esp32c3" "-I{compiler.sdk.path}/include/jsmn/include" "-I{compiler.sdk.path}/include/json/cJSON" "-I{compiler.sdk.path}/include/libsodium/libsodium/src/libsodium/include" "-I{compiler.sdk.path}/include/libsodium/port_include" "-I{compiler.sdk.path}/include/mqtt/esp-mqtt/include" "-I{compiler.sdk.path}/include/openssl/include" "-I{compiler.sdk.path}/include/spiffs/include" "-I{compiler.sdk.path}/include/wifi_provisioning/include" "-I{compiler.sdk.path}/include/esp_littlefs/src" "-I{compiler.sdk.path}/include/esp_littlefs/include" "-I{compiler.sdk.path}/include/esp-face/include" "-I{compiler.sdk.path}/include/esp-face/include/tool" "-I{compiler.sdk.path}/include/esp-face/include/typedef" "-I{compiler.sdk.path}/include/esp-face/include/image" "-I{compiler.sdk.path}/include/esp-face/include/math" "-I{compiler.sdk.path}/include/esp-face/include/nn" "-I{compiler.sdk.path}/include/esp-face/include/layer" "-I{compiler.sdk.path}/include/esp-face/include/detect" "-I{compiler.sdk.path}/include/esp-face/include/model_zoo" "-I{compiler.sdk.path}/include/fb_gfx/include" compiler.c.elf.libs.esp32c3=-lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lasio -lbt -lcbor -lunity -lcmock -lcoap -lnghttp -lesp-tls -lesp_adc_cal -lesp_hid -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lesp_https_server -lesp_lcd -lprotobuf-c -lprotocomm -lmdns -lesp_local_ctrl -lsdmmc -lesp_serial_slave_link -lesp_websocket_client -lexpat -lwear_levelling -lfatfs -lfreemodbus -ljsmn -ljson -llibsodium -lmqtt -lopenssl -lspiffs -lwifi_provisioning -lesp_littlefs -lfb_gfx -lasio -lcbor -lcmock -lunity -lcoap -lesp_lcd -lesp_local_ctrl -lesp_https_server -lesp_websocket_client -lexpat -lfreemodbus -ljsmn -llibsodium -lmqtt -lesp_adc_cal -lesp_hid -lfatfs -lwear_levelling -lopenssl -lspiffs -lwifi_provisioning -lprotocomm -lbt -lbtdm_app -lprotobuf-c -lmdns -ljson -lcat_face_detect -lhuman_face_detect -lcolor_detect -lmfn -ldl -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lesp_ringbuf -lefuse -lesp_ipc -ldriver -lesp_pm -lmbedtls -lapp_update -lbootloader_support -lspi_flash -lnvs_flash -lpthread -lesp_gdbstub -lespcoredump -lesp_phy -lesp_system -lesp_rom -lhal -lvfs -lesp_eth -ltcpip_adapter -lesp_netif -lesp_event -lwpa_supplicant -lesp_wifi -lconsole -llwip -llog -lheap -lsoc -lesp_hw_support -lriscv -lesp_common -lesp_timer -lfreertos -lnewlib -lcxx -lapp_trace -lnghttp -lesp-tls -ltcp_transport -lesp_http_client -lesp_http_server -lesp_https_ota -lsdmmc -lesp_serial_slave_link -lmbedtls -lmbedcrypto -lmbedx509 -lcoexist -lcore -lespnow -lmesh -lnet80211 -lpp -lsmartconfig -lwapi -lphy -lbtbb -lesp_phy -lphy -lbtbb -lesp_phy -lphy -lbtbb -lm -lnewlib -lstdc++ -lpthread -lgcc -lcxx -lapp_trace -lgcov -lapp_trace -lgcov -lc compiler.c.flags.esp32c3=-march=rv32imc -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Wno-error=format= -nostartfiles -Wno-format -Os -freorder-blocks -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu99 -Wno-old-style-declaration -MMD -c compiler.cpp.flags.esp32c3=-march=rv32imc -ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Wno-error=format= -nostartfiles -Wno-format -Os -freorder-blocks -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -std=gnu++11 -fno-exceptions -fno-rtti -MMD -c compiler.S.flags.esp32c3=-ffunction-sections -fdata-sections -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-sign-compare -ggdb -Wno-error=format= -nostartfiles -Wno-format -Os -freorder-blocks -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -fno-jump-tables -fno-tree-switch-conversion -x assembler-with-cpp -MMD -c -compiler.c.elf.flags.esp32c3=-T memory.ld -T sections.ld -T esp32c3.rom.ld -T esp32c3.rom.api.ld -T esp32c3.rom.libgcc.ld -T esp32c3.rom.newlib.ld -T esp32c3.rom.version.ld -T esp32c3.rom.eco3.ld -T esp32c3.peripherals.ld -nostartfiles -march=rv32imc --specs=nosys.specs -Wl,--cref -Wl,--gc-sections -fno-rtti -fno-lto -u _Z5setupv -u _Z4loopv -Wl,--wrap=mbedtls_mpi_exp_mod -u esp_app_desc -u pthread_include_pthread_impl -u pthread_include_pthread_cond_impl -u pthread_include_pthread_local_storage_impl -u start_app -u __ubsan_include -u __assert_func -u vfs_include_syscalls_impl -Wl,--undefined=uxTopUsedPriority -u app_main -u newlib_include_heap_impl -u newlib_include_syscalls_impl -u newlib_include_pthread_impl -u newlib_include_assert_impl -Wl,--wrap=_Unwind_SetEnableExceptionFdeSorting -Wl,--wrap=__register_frame_info_bases -Wl,--wrap=__register_frame_info -Wl,--wrap=__register_frame -Wl,--wrap=__register_frame_info_table_bases -Wl,--wrap=__register_frame_info_table -Wl,--wrap=__register_frame_table -Wl,--wrap=__deregister_frame_info_bases -Wl,--wrap=__deregister_frame_info -Wl,--wrap=_Unwind_Find_FDE -Wl,--wrap=_Unwind_GetGR -Wl,--wrap=_Unwind_GetCFA -Wl,--wrap=_Unwind_GetIP -Wl,--wrap=_Unwind_GetIPInfo -Wl,--wrap=_Unwind_GetRegionStart -Wl,--wrap=_Unwind_GetDataRelBase -Wl,--wrap=_Unwind_GetTextRelBase -Wl,--wrap=_Unwind_SetIP -Wl,--wrap=_Unwind_SetGR -Wl,--wrap=_Unwind_GetLanguageSpecificData -Wl,--wrap=_Unwind_FindEnclosingFunction -Wl,--wrap=_Unwind_Resume -Wl,--wrap=_Unwind_RaiseException -Wl,--wrap=_Unwind_DeleteException -Wl,--wrap=_Unwind_ForcedUnwind -Wl,--wrap=_Unwind_Resume_or_Rethrow -Wl,--wrap=_Unwind_Backtrace -Wl,--wrap=__cxa_call_unexpected -Wl,--wrap=__gxx_personality_v0 -u __cxa_guard_dummy -u __cxx_fatal_exception +compiler.c.elf.flags.esp32c3=-T memory.ld -T sections.ld -T esp32c3.rom.ld -T esp32c3.rom.api.ld -T esp32c3.rom.libgcc.ld -T esp32c3.rom.newlib.ld -T esp32c3.rom.version.ld -T esp32c3.rom.eco3.ld -T esp32c3.peripherals.ld -nostartfiles -march=rv32imc --specs=nosys.specs -Wl,--cref -Wl,--gc-sections -fno-rtti -fno-lto -u _Z5setupv -u _Z4loopv -u esp_app_desc -u pthread_include_pthread_impl -u pthread_include_pthread_cond_impl -u pthread_include_pthread_local_storage_impl -u pthread_include_pthread_rwlock_impl -u start_app -u __ubsan_include -u __assert_func -u vfs_include_syscalls_impl -Wl,--undefined=uxTopUsedPriority -u app_main -u newlib_include_heap_impl -u newlib_include_syscalls_impl -u newlib_include_pthread_impl -u newlib_include_assert_impl -Wl,--wrap=_Unwind_SetEnableExceptionFdeSorting -Wl,--wrap=__register_frame_info_bases -Wl,--wrap=__register_frame_info -Wl,--wrap=__register_frame -Wl,--wrap=__register_frame_info_table_bases -Wl,--wrap=__register_frame_info_table -Wl,--wrap=__register_frame_table -Wl,--wrap=__deregister_frame_info_bases -Wl,--wrap=__deregister_frame_info -Wl,--wrap=_Unwind_Find_FDE -Wl,--wrap=_Unwind_GetGR -Wl,--wrap=_Unwind_GetCFA -Wl,--wrap=_Unwind_GetIP -Wl,--wrap=_Unwind_GetIPInfo -Wl,--wrap=_Unwind_GetRegionStart -Wl,--wrap=_Unwind_GetDataRelBase -Wl,--wrap=_Unwind_GetTextRelBase -Wl,--wrap=_Unwind_SetIP -Wl,--wrap=_Unwind_SetGR -Wl,--wrap=_Unwind_GetLanguageSpecificData -Wl,--wrap=_Unwind_FindEnclosingFunction -Wl,--wrap=_Unwind_Resume -Wl,--wrap=_Unwind_RaiseException -Wl,--wrap=_Unwind_DeleteException -Wl,--wrap=_Unwind_ForcedUnwind -Wl,--wrap=_Unwind_Resume_or_Rethrow -Wl,--wrap=_Unwind_Backtrace -Wl,--wrap=__cxa_call_unexpected -Wl,--wrap=__gxx_personality_v0 -u __cxa_guard_dummy -u __cxx_fatal_exception compiler.ar.flags.esp32c3=cr build.extra_flags.esp32c3=-DARDUINO_HW_CDC_ON_BOOT={build.cdc_on_boot} # @@ -148,7 +148,7 @@ recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.fla recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" ## Combine gc-sections, archives, and objects -recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-Wl,--Map={build.path}/{build.project_name}.map" "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {build.extra_flags} {compiler.libraries.ldflags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf" +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" "-Wl,--Map={build.path}/{build.project_name}.map" "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} {build.extra_flags} -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} {compiler.libraries.ldflags} -Wl,--end-group -Wl,-EL -o "{build.path}/{build.project_name}.elf" ## Create partitions.bin recipe.objcopy.partitions.bin.pattern={tools.gen_esp32part.cmd} -q "{build.path}/partitions.csv" "{build.path}/{build.project_name}.partitions.bin" diff --git a/tools/platformio-build-esp32.py b/tools/platformio-build-esp32.py index 1d5a5241ce9..fbbfcf3d8e5 100644 --- a/tools/platformio-build-esp32.py +++ b/tools/platformio-build-esp32.py @@ -81,7 +81,6 @@ "-Wl,--gc-sections", "-fno-rtti", "-fno-lto", - "-Wl,--wrap=mbedtls_mpi_exp_mod", "-Wl,--wrap=longjmp", "-Wl,--undefined=uxTopUsedPriority", "-T", "esp32.rom.redefined.ld", @@ -100,6 +99,7 @@ "-u", "pthread_include_pthread_impl", "-u", "pthread_include_pthread_cond_impl", "-u", "pthread_include_pthread_local_storage_impl", + "-u", "pthread_include_pthread_rwlock_impl", "-u", "ld_include_highint_hdl", "-u", "start_app", "-u", "start_app_other_cores", @@ -303,8 +303,9 @@ "UNITY_INCLUDE_CONFIG_H", "WITH_POSIX", "_GNU_SOURCE", - ("IDF_VER", '\\"v4.4-dev-3569-g6a7d83af19\\"'), + ("IDF_VER", '\\"v4.4-beta1-189-ga79dc75f0a\\"'), "ESP_PLATFORM", + "_POSIX_READER_WRITER_LOCKS", "ARDUINO_ARCH_ESP32", "ESP32", ("F_CPU", "$BOARD_F_CPU"), diff --git a/tools/platformio-build-esp32c3.py b/tools/platformio-build-esp32c3.py index 58dd07faf03..f0f86d5ba9e 100644 --- a/tools/platformio-build-esp32c3.py +++ b/tools/platformio-build-esp32c3.py @@ -81,7 +81,6 @@ "-Wl,--gc-sections", "-fno-rtti", "-fno-lto", - "-Wl,--wrap=mbedtls_mpi_exp_mod", "-Wl,--undefined=uxTopUsedPriority", "-Wl,--wrap=_Unwind_SetEnableExceptionFdeSorting", "-Wl,--wrap=__register_frame_info_bases", @@ -127,6 +126,7 @@ "-u", "pthread_include_pthread_impl", "-u", "pthread_include_pthread_cond_impl", "-u", "pthread_include_pthread_local_storage_impl", + "-u", "pthread_include_pthread_rwlock_impl", "-u", "start_app", "-u", "__ubsan_include", "-u", "__assert_func", @@ -293,8 +293,9 @@ "UNITY_INCLUDE_CONFIG_H", "WITH_POSIX", "_GNU_SOURCE", - ("IDF_VER", '\\"v4.4-dev-3569-g6a7d83af19\\"'), + ("IDF_VER", '\\"v4.4-beta1-189-ga79dc75f0a\\"'), "ESP_PLATFORM", + "_POSIX_READER_WRITER_LOCKS", "ARDUINO_ARCH_ESP32", "ESP32", ("F_CPU", "$BOARD_F_CPU"), diff --git a/tools/platformio-build-esp32s2.py b/tools/platformio-build-esp32s2.py index 78aed0892b2..5e4d496de6e 100644 --- a/tools/platformio-build-esp32s2.py +++ b/tools/platformio-build-esp32s2.py @@ -95,6 +95,7 @@ "-u", "pthread_include_pthread_impl", "-u", "pthread_include_pthread_cond_impl", "-u", "pthread_include_pthread_local_storage_impl", + "-u", "pthread_include_pthread_rwlock_impl", "-u", "ld_include_highint_hdl", "-u", "start_app", "-u", "__ubsan_include", @@ -289,8 +290,9 @@ "UNITY_INCLUDE_CONFIG_H", "WITH_POSIX", "_GNU_SOURCE", - ("IDF_VER", '\\"v4.4-dev-3569-g6a7d83af19\\"'), + ("IDF_VER", '\\"v4.4-beta1-189-ga79dc75f0a\\"'), "ESP_PLATFORM", + "_POSIX_READER_WRITER_LOCKS", "ARDUINO_ARCH_ESP32", "ESP32", ("F_CPU", "$BOARD_F_CPU"), diff --git a/tools/sdk/esp32/bin/bootloader_dio_40m.bin b/tools/sdk/esp32/bin/bootloader_dio_40m.bin index 97c4c99695b..ee6d1d320b2 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dio_40m.bin and b/tools/sdk/esp32/bin/bootloader_dio_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_dio_80m.bin b/tools/sdk/esp32/bin/bootloader_dio_80m.bin index 30a2681f021..238c5578b7b 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dio_80m.bin and b/tools/sdk/esp32/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_dout_40m.bin b/tools/sdk/esp32/bin/bootloader_dout_40m.bin index bd7c316fcd2..488a7bbb3fe 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dout_40m.bin and b/tools/sdk/esp32/bin/bootloader_dout_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_dout_80m.bin b/tools/sdk/esp32/bin/bootloader_dout_80m.bin index 44ee9d6cfc9..77ed1d3e630 100644 Binary files a/tools/sdk/esp32/bin/bootloader_dout_80m.bin and b/tools/sdk/esp32/bin/bootloader_dout_80m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qio_40m.bin b/tools/sdk/esp32/bin/bootloader_qio_40m.bin index 958ddfe8135..59b2b6e4413 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qio_40m.bin and b/tools/sdk/esp32/bin/bootloader_qio_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qio_80m.bin b/tools/sdk/esp32/bin/bootloader_qio_80m.bin index bf18af59925..15bf321d2ca 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qio_80m.bin and b/tools/sdk/esp32/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qout_40m.bin b/tools/sdk/esp32/bin/bootloader_qout_40m.bin index 93d6ff461aa..27f59601fc6 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qout_40m.bin and b/tools/sdk/esp32/bin/bootloader_qout_40m.bin differ diff --git a/tools/sdk/esp32/bin/bootloader_qout_80m.bin b/tools/sdk/esp32/bin/bootloader_qout_80m.bin index 1edaf34822d..2af6988c83c 100644 Binary files a/tools/sdk/esp32/bin/bootloader_qout_80m.bin and b/tools/sdk/esp32/bin/bootloader_qout_80m.bin differ diff --git a/tools/sdk/esp32/include/app_trace/include/esp_app_trace_util.h b/tools/sdk/esp32/include/app_trace/include/esp_app_trace_util.h index 0ee501b27fa..96595c69827 100644 --- a/tools/sdk/esp32/include/app_trace/include/esp_app_trace_util.h +++ b/tools/sdk/esp32/include/app_trace/include/esp_app_trace_util.h @@ -68,7 +68,7 @@ typedef struct { */ static inline void esp_apptrace_lock_init(esp_apptrace_lock_t *lock) { - vPortCPUInitializeMutex(&lock->mux); + portMUX_INITIALIZE(&lock->mux); lock->int_state = 0; } diff --git a/tools/sdk/esp32/include/config/sdkconfig.h b/tools/sdk/esp32/include/config/sdkconfig.h index 68b8d825f2b..fa51634dabd 100644 --- a/tools/sdk/esp32/include/config/sdkconfig.h +++ b/tools/sdk/esp32/include/config/sdkconfig.h @@ -291,6 +291,7 @@ #define CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0 1 #define CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN 752 #define CONFIG_ESP32_WIFI_MGMT_SBUF_NUM 32 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 #define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1 #define CONFIG_FATFS_CODEPAGE_850 1 #define CONFIG_FATFS_CODEPAGE 850 @@ -346,6 +347,7 @@ #define CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE 0 #define CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER 1 #define CONFIG_FREERTOS_DEBUG_OCDAWARE 1 +#define CONFIG_FREERTOS_FPU_IN_ISR 1 #define CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT 1 #define CONFIG_HAL_ASSERTION_EQUALS_SYSTEM 1 #define CONFIG_HAL_DEFAULT_ASSERTION_LEVEL 2 @@ -370,6 +372,7 @@ #define CONFIG_LWIP_ESP_GRATUITOUS_ARP 1 #define CONFIG_LWIP_GARP_TMR_INTERVAL 60 #define CONFIG_LWIP_TCPIP_RECVMBOX_SIZE 32 +#define CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID 1 #define CONFIG_LWIP_DHCP_RESTORE_LAST_IP 1 #define CONFIG_LWIP_DHCP_OPTIONS_LEN 128 #define CONFIG_LWIP_DHCPS 1 @@ -403,7 +406,9 @@ #define CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS 5 #define CONFIG_LWIP_ICMP 1 #define CONFIG_LWIP_MAX_RAW_PCBS 16 -#define CONFIG_LWIP_SNTP_MAX_SERVERS 1 +#define CONFIG_LWIP_SNTP_MAX_SERVERS 3 +#define CONFIG_LWIP_DHCP_GET_NTP_SRV 1 +#define CONFIG_LWIP_DHCP_MAX_NTP_SERVERS 1 #define CONFIG_LWIP_SNTP_UPDATE_DELAY 3600000 #define CONFIG_LWIP_ESP_LWIP_ASSERT 1 #define CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT 1 @@ -636,6 +641,7 @@ #define CONFIG_OPTIMIZATION_LEVEL_RELEASE CONFIG_COMPILER_OPTIMIZATION_SIZE #define CONFIG_POST_EVENTS_FROM_IRAM_ISR CONFIG_ESP_EVENT_POST_FROM_IRAM_ISR #define CONFIG_POST_EVENTS_FROM_ISR CONFIG_ESP_EVENT_POST_FROM_ISR +#define CONFIG_REDUCE_PHY_TX_POWER CONFIG_ESP_PHY_REDUCE_TX_POWER #define CONFIG_SCAN_DUPLICATE_BY_DEVICE_ADDR CONFIG_BTDM_SCAN_DUPL_TYPE_DEVICE #define CONFIG_SEMIHOSTFS_HOST_PATH_MAX_LEN CONFIG_VFS_SEMIHOSTFS_HOST_PATH_MAX_LEN #define CONFIG_SEMIHOSTFS_MAX_MOUNT_POINTS CONFIG_VFS_SEMIHOSTFS_MAX_MOUNT_POINTS @@ -673,5 +679,5 @@ #define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS #define CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP -#define CONFIG_ARDUINO_IDF_COMMIT "6a7d83af19" +#define CONFIG_ARDUINO_IDF_COMMIT "a79dc75f0a" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32/include/driver/include/driver/mcpwm.h b/tools/sdk/esp32/include/driver/include/driver/mcpwm.h index 2a4e825f77c..fed2c3f326d 100644 --- a/tools/sdk/esp32/include/driver/include/driver/mcpwm.h +++ b/tools/sdk/esp32/include/driver/include/driver/mcpwm.h @@ -174,7 +174,6 @@ typedef enum { /** * @brief Interrupt masks for MCPWM capture */ -__attribute__ ((deprecated("please use callback function to avoid directly accessing registers"))) typedef enum { MCPWM_LL_INTR_CAP0 = BIT(27), ///< Capture 0 happened MCPWM_LL_INTR_CAP1 = BIT(28), ///< Capture 1 happened @@ -922,7 +921,6 @@ esp_err_t mcpwm_sync_invert_gpio_synchro(mcpwm_unit_t mcpwm_num, mcpwm_sync_sign * - ESP_OK Success * - ESP_ERR_INVALID_ARG Function pointer error. */ -__attribute__((deprecated("interrupt events are handled by driver, please use callback"))) esp_err_t mcpwm_isr_register(mcpwm_unit_t mcpwm_num, void (*fn)(void *), void *arg, int intr_alloc_flags, intr_handle_t *handle); diff --git a/tools/sdk/esp32/include/efuse/include/esp_efuse.h b/tools/sdk/esp32/include/efuse/include/esp_efuse.h index a44aa798720..02300ccfa72 100644 --- a/tools/sdk/esp32/include/efuse/include/esp_efuse.h +++ b/tools/sdk/esp32/include/efuse/include/esp_efuse.h @@ -6,11 +6,9 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - +#include #include + #include "esp_err.h" #include "esp_log.h" #include "soc/soc_caps.h" @@ -29,6 +27,10 @@ extern "C" { #include "esp32h2/rom/secure_boot.h" #endif +#ifdef __cplusplus +extern "C" { +#endif + #define ESP_ERR_EFUSE 0x1600 /*!< Base error code for efuse api. */ #define ESP_OK_EFUSE_CNT (ESP_ERR_EFUSE + 0x01) /*!< OK the required number of bits is set. */ #define ESP_ERR_EFUSE_CNT_IS_FULL (ESP_ERR_EFUSE + 0x02) /*!< Error field is full. */ diff --git a/tools/sdk/esp32/include/esp-face/include/image/dl_image.hpp b/tools/sdk/esp32/include/esp-face/include/image/dl_image.hpp index 4a974df063a..8e8a4df705b 100644 --- a/tools/sdk/esp32/include/esp-face/include/image/dl_image.hpp +++ b/tools/sdk/esp32/include/esp-face/include/image/dl_image.hpp @@ -48,6 +48,15 @@ namespace dl output[2] = input & 0xF8; // red } + /** + * @brief Convert RGB565 image to RGB888 image. + * + * @param image ptr of RGB565 image + * @param image_shape shape of the input image + * @return Tensor* output RGB88 image + */ + Tensor *convert_image_rgb565_to_rgb888(uint16_t *image, std::vector &image_shape); + /** * @brief Convert RGB565 pixel to Gray. * @@ -435,5 +444,48 @@ namespace dl */ Tensor *rgb2hsv(Tensor &image, bool bgr = false, bool fast = true); + /** + * @brief resize an image to the target shape. + * + * @param image the input image Tensor + * @param target_shape the target shape of the resized image. + * @param resize_type one of IMAGE_RESIZE_BILINEAR or IMAGE_RESIZE_MEAN or IMAGE_RESIZE_NEAREST + * @return Tensor* the pointer of the resized image Tensor + */ + Tensor *resize_image(Tensor &image, std::vector target_shape, resize_type_t resize_type); + + /** + * @brief resize an image to the target shape. + * + * @param image the input image Tensor + * @param resized_image the resized image Tensor + * @param resize_type one of IMAGE_RESIZE_BILINEAR or IMAGE_RESIZE_MEAN or IMAGE_RESIZE_NEAREST + */ + void resize_image(Tensor &image, Tensor &resized_image, resize_type_t resize_type); + + /** + * @brief resize an image to the target shape with nearest method. + * + * @tparam T + * @param image the pointer of the input image + * @param input_shape the input shape of the image + * @param target_shape the target shape of the resized image + * @return T* the pointer of the resized image + */ + template + T *resize_image_nearest(T *image, std::vector input_shape, std::vector target_shape); + + /** + * @brief resize an image to the target shape with nearest method. + * + * @tparam T + * @param image the pointer of the input image + * @param input_shape the input shape of the image + * @param resized_image the pointer of the resized image + * @param target_shape the target shape of the resized image + */ + template + void resize_image_nearest(T *image, std::vector input_shape, T *resized_image, std::vector target_shape); + } // namespace image } // namespace dl diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp index 8a9aaa8dfbe..57c7fb64a9a 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp @@ -57,10 +57,10 @@ namespace dl const char *name = "AvgPool2D") : Layer(name), output_exponent(output_exponent), filter_shape(filter_shape), - padding_type(padding_type), - padding(padding), stride_y(stride_y), stride_x(stride_x), + padding_type(padding_type), + padding(padding), output_shape({}) { this->output = new Tensor; diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_expand_dims.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_expand_dims.hpp index a59bed183fb..99fdc2ed607 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_expand_dims.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_expand_dims.hpp @@ -36,7 +36,10 @@ namespace dl * false: the output will store to a separate memory */ ExpandDims(std::vector axis, const char *name = "ExpandDims", bool inplace = false) : Layer(name), - axis(axis), inplace(inplace), output_shape({}) + output_shape({}), + axis(axis), + output(NULL), + inplace(inplace) { } @@ -63,19 +66,18 @@ namespace dl this->output_exponent = input.exponent; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } this->output->set_exponent(this->output_exponent); - this->output->set_shape(this->output_shape); + this->output->set_shape(input.shape); this->output->expand_dims(this->axis); this->output->free_element(); } else { this->output = &input; - this->output->set_shape(this->output_shape); this->output->expand_dims(this->axis); } this->output_shape = this->output->shape; diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_flatten.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_flatten.hpp index 70ae483a07f..380df1a413b 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_flatten.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_flatten.hpp @@ -32,7 +32,7 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - Flatten(const char *name = "Flatten", bool inplace = false) : Layer(name), inplace(inplace), output_shape({}) + Flatten(const char *name = "Flatten", bool inplace = false) : Layer(name), output(NULL), inplace(inplace), output_shape({}) {} /** @@ -59,7 +59,7 @@ namespace dl this->output_shape = {input.get_size()}; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_leakyrelu.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_leakyrelu.hpp index a972e135006..773c62430f2 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_leakyrelu.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_leakyrelu.hpp @@ -10,14 +10,14 @@ namespace dl namespace layer { /** - * @brief LeakyReLU(input). + * @brief LeakyRelu(input). * * @tparam feature_t supports int16_t and int8_t, * - int16_t: stands for operation in int16_t quantize * - int8_t: stands for operation in int8_t quantize */ template - class LeakyReLU : public Layer + class LeakyRelu : public Layer { private: feature_t activation_alpha; /**/ @@ -28,7 +28,7 @@ namespace dl std::vector output_shape; /**/ public: /** - * @brief Construct a new LeakyReLU object + * @brief Construct a new LeakyRelu object * * @param activation_alpha quantized alpha * @param activation_exponent exponent of quantized alpha @@ -36,7 +36,7 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - LeakyReLU(const int activation_alpha, const int activation_exponent, const char *name = "LeakyReLU", bool inplace = false) : Layer(name), output(NULL), output_shape({}) + LeakyRelu(const int activation_alpha, const int activation_exponent, const char *name = "LeakyRelu", bool inplace = false) : Layer(name), output(NULL), output_shape({}) { this->activation_alpha = activation_alpha; this->activation_exponent = activation_exponent; @@ -44,10 +44,10 @@ namespace dl } /** - * @brief Destroy the LeakyReLU object + * @brief Destroy the LeakyRelu object * */ - ~LeakyReLU() + ~LeakyRelu() { if ((!this->inplace) && (this->output != NULL)) { @@ -66,7 +66,7 @@ namespace dl this->output_shape = input.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -90,7 +90,7 @@ namespace dl /** * @brief Get the output * - * @return Tensor& LeakyReLU result + * @return Tensor& LeakyRelu result */ Tensor &get_output() { @@ -98,11 +98,11 @@ namespace dl } /** - * @brief Call LeakyReLU operation. + * @brief Call LeakyRelu operation. * * @param input as an input * @param assign_core not effective yet - * @return LeakyReLU result + * @return LeakyRelu result */ Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) { @@ -130,7 +130,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::leakyrelu(*this->output, input, this->activation_alpha, this->activation_exponent, assign_core); + nn::leakyrelu(*this->output, input, this->activation_alpha, this->activation_exponent, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "leakyrelu"); } diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_max2d.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_max2d.hpp index c6be15638ab..e7defa0b08f 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_max2d.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_max2d.hpp @@ -68,7 +68,7 @@ namespace dl if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -132,7 +132,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::max2d(*this->output, input0, input1, assign_core); + nn::max2d(*this->output, input0, input1, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "max2d"); } diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_max_pool2d.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_max_pool2d.hpp index 629aa87f515..7c7fc69fa71 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_max_pool2d.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_max_pool2d.hpp @@ -53,10 +53,10 @@ namespace dl const int stride_x = 1, const char *name = "MaxPool2D") : Layer(name), filter_shape(filter_shape), - padding_type(padding_type), - padding(padding), stride_y(stride_y), stride_x(stride_x), + padding_type(padding_type), + padding(padding), output_shape({}) { this->output = new Tensor; diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_min2d.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_min2d.hpp index e38fbf3d0d2..609566348d3 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_min2d.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_min2d.hpp @@ -68,7 +68,7 @@ namespace dl if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -132,7 +132,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::min2d(*this->output, input0, input1, assign_core); + nn::min2d(*this->output, input0, input1, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "min2d"); } diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_mul2d.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_mul2d.hpp index 21bcca7a81e..a391c790335 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_mul2d.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_mul2d.hpp @@ -75,7 +75,7 @@ namespace dl if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -140,7 +140,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::mul2d(*this->output, input0, input1, this->activation, assign_core); + nn::mul2d(*this->output, input0, input1, this->activation, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "mul2d"); } diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_prelu.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_prelu.hpp index 96168a783b1..2141e986646 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_prelu.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_prelu.hpp @@ -10,17 +10,17 @@ namespace dl namespace layer { /** - * @brief PReLU(input). + * @brief PRelu(input). * * @tparam feature_t supports int16_t and int8_t, * - int16_t: stands for operation in int16_t quantize * - int8_t: stands for operation in int8_t quantize */ template - class PReLU : public Layer + class PRelu : public Layer { private: - feature_t *activation_element; /**/ + const feature_t *activation_element; /**/ int activation_exponent; /**/ Tensor *output; /**/ bool inplace; /* output_shape; /**/ public: /** - * @brief Construct a new PReLU object + * @brief Construct a new PRelu object * * @param activation_element quantized alpha elements along channel axis * @param activation_exponent exponent of quantized alpha elements @@ -36,10 +36,10 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - PReLU(const feature_t *activation_element, + PRelu(const feature_t *activation_element, const int activation_exponent = 0, - const char *name = NULL, - bool inplace = "PReLU") : Layer(name), + const char *name = "PRelu", + bool inplace = false) : Layer(name), activation_element(activation_element), activation_exponent(activation_exponent), output(NULL), @@ -49,10 +49,10 @@ namespace dl } /** - * @brief Destroy the PReLU object + * @brief Destroy the PRelu object * */ - ~PReLU() + ~PRelu() { if ((!this->inplace) && (this->output != NULL)) { @@ -71,7 +71,7 @@ namespace dl this->output_shape = input.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -94,7 +94,7 @@ namespace dl /** * @brief Get the output * - * @return Tensor& PReLU result + * @return Tensor& PRelu result */ Tensor &get_output() { @@ -102,11 +102,11 @@ namespace dl } /** - * @brief Call PReLU operation. + * @brief Call PRelu operation. * * @param input as an input * @param assign_core not effective yet - * @return PReLU result + * @return PRelu result */ Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) { @@ -125,7 +125,7 @@ namespace dl DL_LOG_LAYER_LATENCY_START(); nn::prelu(*this->output, input, this->activation_element, this->activation_exponent, assign_core); - DL_LOG_LAYER_LATENCY_END(this->name, "leakyrelu"); + DL_LOG_LAYER_LATENCY_END(this->name, "prelu"); } else { @@ -135,7 +135,7 @@ namespace dl this->output->set_shape(this->output_shape); } nn::prelu(*this->output, input, this->activation_element, this->activation_exponent, assign_core); - DL_LOG_LAYER_LATENCY_END(this->name, "leakyrelu"); + DL_LOG_LAYER_LATENCY_END(this->name, "prelu"); } return *this->output; diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_relu.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_relu.hpp index 7dd29d4a178..dff05c7f420 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_relu.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_relu.hpp @@ -18,7 +18,7 @@ namespace dl * - int8_t: stands for operation in int8_t quantize */ template - class ReLU : public Layer + class Relu : public Layer { private: Tensor *output; /**/ @@ -33,7 +33,7 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - ReLU(const char *name = "ReLU", bool inplace = false) : Layer(name), + Relu(const char *name = "Relu", bool inplace = false) : Layer(name), output(NULL), inplace(inplace), output_shape({}) { } @@ -42,7 +42,7 @@ namespace dl * @brief Destroy the ReLU object * */ - ~ReLU() + ~Relu() { if ((!this->inplace) && (this->output != NULL)) { @@ -61,7 +61,7 @@ namespace dl this->output_shape = input.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_reshape.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_reshape.hpp index 3f2ed72b6e0..2ef76ef96d8 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_reshape.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_reshape.hpp @@ -35,7 +35,9 @@ namespace dl * false: the output will store to a separate memory */ Reshape(std::vector shape, const char *name = "Reshape", bool inplace = false) : Layer(name), - output_shape(shape), inplace(inplace) + output(NULL), + inplace(inplace), + output_shape(shape) { } @@ -62,19 +64,21 @@ namespace dl this->output_exponent = input.exponent; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } this->output->set_exponent(this->output_exponent); - this->output->set_shape(this->output_shape); + this->output->set_shape(input.shape); + this->output->reshape(this->output_shape); this->output->free_element(); } else { this->output = &input; - this->output->set_shape(this->output_shape); + this->output->reshape(this->output_shape); } + this->output_shape = this->output->shape; if (print_shape) { diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_squeeze.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_squeeze.hpp index cee92f22764..710901a3d02 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_squeeze.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_squeeze.hpp @@ -35,7 +35,11 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - Squeeze(int axis = INT32_MAX, const char *name = "Squeeze", bool inplace = false) : Layer(name), axis(axis), inplace(inplace), output_shape({}) + Squeeze(int axis = INT32_MAX, const char *name = "Squeeze", bool inplace = false) : Layer(name), + output(NULL), + inplace(inplace), + axis(axis), + output_shape({}) { } @@ -62,7 +66,7 @@ namespace dl this->output_exponent = input.exponent; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -74,7 +78,6 @@ namespace dl else { this->output = &input; - this->output->set_shape(input.shape); this->output->squeeze(this->axis); } this->output_shape = this->output->shape; diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_sub2d.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_sub2d.hpp index da03b4aad85..61bcc9f2804 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_sub2d.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_sub2d.hpp @@ -38,7 +38,11 @@ namespace dl * false: the output will store to a separate memory */ Sub2D(const int output_exponent, const Activation *activation = NULL, const char *name = "Sub2D", bool inplace = false) : Layer(name), - output_exponent(output_exponent), activation(activation), output(NULL), inplace(inplace), output_shape({}) + output_exponent(output_exponent), + activation(activation), + output(NULL), + inplace(inplace), + output_shape({}) { } @@ -67,7 +71,7 @@ namespace dl this->output_shape = input0.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -116,12 +120,12 @@ namespace dl { this->output->set_shape(this->output_shape); } - this->output.malloc_element(); + this->output->malloc_element(); this->output->set_exponent(input0.exponent); DL_LOG_LAYER_LATENCY_END(this->name, "apply"); DL_LOG_LAYER_LATENCY_START(); - nn::sub2d(this->output, input0, input1, this->activation, assign_core); + nn::sub2d(*this->output, input0, input1, this->activation, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "sub2d"); } else @@ -131,7 +135,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::sub2d(this->output, input0, input1, this->activation, assign_core, this->output_exponent); + nn::sub2d(*this->output, input0, input1, this->activation, assign_core, this->output_exponent); DL_LOG_LAYER_LATENCY_END(this->name, "sub2d"); } return *this->output; diff --git a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_transpose.hpp b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_transpose.hpp index d89ba8daed5..87e9cce5ce4 100644 --- a/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_transpose.hpp +++ b/tools/sdk/esp32/include/esp-face/include/layer/dl_layer_transpose.hpp @@ -33,7 +33,11 @@ namespace dl * @param inplace true: the output will store to input * false: the output will store to a separate memory */ - Transpose(std::vector perm = {}, const char *name = "Transpose", bool inplace = false) : Layer(name), perm(perm), inplace(inplace), output_shape({}) + Transpose(std::vector perm = {}, const char *name = "Transpose", bool inplace = false) : Layer(name), + output(NULL), + inplace(inplace), + perm(perm), + output_shape({}) { } @@ -59,13 +63,24 @@ namespace dl { this->output_exponent = input.exponent; this->output_shape = input.shape; - for (int i = 0; i < this->perm.size(); i++) + int dims = this->output_shape.size(); + if (this->perm.size() == 0) { + for (int i = dims - 1; i >= 0; i--) + { + this->perm.push_back(i); + } + } + for (int i = 0; i < dims; ++i) + { + if (this->perm[i] < 0) + this->perm[i] = dims + this->perm[i]; this->output_shape[i] = input.shape[this->perm[i]]; } + if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } diff --git a/tools/sdk/esp32/include/esp-face/include/model_zoo/color_detector.hpp b/tools/sdk/esp32/include/esp-face/include/model_zoo/color_detector.hpp index 063ab20b34a..f79f98c0fd2 100644 --- a/tools/sdk/esp32/include/esp-face/include/model_zoo/color_detector.hpp +++ b/tools/sdk/esp32/include/esp-face/include/model_zoo/color_detector.hpp @@ -7,46 +7,143 @@ typedef struct int area; /*!< Area of connected domains >*/ std::vector center; /**/ std::vector box; /**/ -} components_stats_t; +} color_detect_result_t; + +typedef struct +{ + std::vector start_col; + std::vector end_col; + std::vector row; + std::vector index; + std::vector area; +} color_segment_result_t; + +typedef struct +{ + std::vector color_thresh; /*!< threshold of colors, The threshold of each color is composed of 6 numbers >*/ + int area_thresh; /*!< the area threshold of each color, + the area that is smaller than the threshold is filtered >*/ + std::string name; /*!*/ +} color_info_t; class ColorDetector { private: - std::vector> results; /*!< detection results >*/ - -public: - std::vector> color_thresh; /*!< threshold of colors, The threshold of each color is composed of 6 numbers >*/ - std::vector area_thresh; /*!< the area threshold of each color, - the area that is smaller than the threshold is filtered >*/ - bool bgr; /*!< true: the input image is in BGR format + std::vector> detection_results; /*!< detection results >*/ + std::vector segmentation_results; /*!< segmentation results >*/ + std::vector registered_colors; /*!< the infomation of registered colors >*/ + std::vector color_thresh_offset; /*!< HSV offset of the registered colors>*/ + std::vector detection_shape; /*!< the inference shape of images, the input image will be resized to this shape. + if the shape == {}, the input image will not be resized >*/ + bool bgr; /*!< true: the input image is in BGR format false: the input image is in RGB format >*/ + int id_nums; /*!< the number of registered colors in history>*/ + float h_ratio; + float w_ratio; + void color_detection_forward(dl::Tensor &bin, int area_thresh); +public: /** * @brief get the color threshold of rectangular region in the image * - * @param image the input image + * @param image the input image in RGB888 format. * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] * @return std::vector the threshold. */ std::vector cal_color_thresh(dl::Tensor &image, std::vector box); + /** + * @brief get the color threshold of rectangular region in the image + * + * @param input the ptr of RGB565 image. + * @param input_shape shape of the input image. + * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] + * @return std::vector the threshold. + */ + std::vector cal_color_thresh(uint16_t *input, std::vector input_shape, std::vector box); + + /** + * @brief register a new color to the color detector + * + * @param image the input image in RGB888 format. + * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] + * @param area_thresh the area threshold of the color + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int register_color(dl::Tensor &image, std::vector box, int area_thresh = 256, std::string color_name = "", int id = -1); + + /** + * @brief register a new color to the color detector + * + * @param input the ptr of RGB565 image. + * @param input_shape shape of the input image. + * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] + * @param area_thresh the area threshold of the color + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int register_color(uint16_t *input, std::vector input_shape, std::vector box, int area_thresh = 256, std::string color_name = "", int id = -1); + + /** + * @brief register a new color to the color detector + * + * @param color_thresh the color threshold + * @param area_thresh the area threshold of the color + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int register_color(std::vector color_thresh, int area_thresh = 256, std::string color_name = "", int id = -1); + + /** + * @brief delete a registered color + * + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int delete_color(int id = -1); + + /** + * @brief delete a registered color + * + * @param color_name name of the registered_color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int delete_color(std::string color_name); + + /** + * @brief delete all the registered colors + * + */ + void clear_color(); + /** * @brief detect the colors based on the color thresholds * * @param image the input image. - * @return std::vector>& detection result. + * @return std::vector>& detection result. + */ + std::vector> &detect(dl::Tensor &image, std::vector color_ids = {}); + + /** + * @brief + * + * @param input + * @param input_shape + * @return std::vector>& */ - std::vector> &detect(dl::Tensor &image); + std::vector> &detect(uint16_t *input_shape, std::vector shape, std::vector color_ids = {}); /** * @brief Construct a new Color Detector object * - * @param color_thresh threshold of colors, The threshold of each color is composed of 6 numbers - * @param area_thresh the area threshold of each color,the area that is smaller than the threshold is filtered + * @param color_thresh_offset HSV offset of the registered colors> + * @param detection_shape the inference shape of images, the input image will be resized to this shape * @param bgr true: the input image is in BGR format * false: the input image is in RGB format */ - ColorDetector(std::vector> color_thresh, std::vector area_thresh, bool bgr = false) : color_thresh(color_thresh), area_thresh(area_thresh), bgr(bgr) + ColorDetector(std::vector color_thresh_offset = {}, std::vector detection_shape = {}, bool bgr = true) : color_thresh_offset(color_thresh_offset), + detection_shape(detection_shape), bgr(bgr), id_nums(0) { } @@ -57,12 +154,213 @@ class ColorDetector ~ColorDetector() {} /** - * @brief Get the results object + * @brief Get the detection results object + * + * @return std::vector>& the detection result. + */ + std::vector> &get_detection_results() + { + return this->detection_results; + } + + /** + * @brief Get the segmentation results object * - * @return std::vector>& the detection result. + * @return std::vector& the segmentation result. */ - std::vector> &get_results() + std::vector &get_segmentation_results() { - return this->results; + return this->segmentation_results; } + + /** + * @brief Get the registered colors object + * + * @return std::vector the information of resgistered colors + */ + std::vector get_registered_colors() + { + return this->registered_colors; + } + + /** + * @brief Set the color thresh offset object + * + * @param color_thresh_offset the offset of color thresh for registered colors + * @return ColorDetector& + */ + ColorDetector &set_color_thresh_offset(std::vector color_thresh_offset) + { + assert(color_thresh_offset.size() == 3); + this->color_thresh_offset = color_thresh_offset; + return *this; + } + + /** + * @brief Get the color thresh offset object + * + * @return std::vector color_thresh_offset + */ + std::vector get_color_thresh_offset() + { + return this->color_thresh_offset; + } + + /** + * @brief Set the area thresh object + * + * @param area_thresh the area thresh for each registered colors + * @return ColorDetector& + */ + ColorDetector &set_area_thresh(std::vector area_thresh) + { + assert((area_thresh.size() == this->registered_colors.size()) || (area_thresh.size() == 1)); + if (area_thresh.size() == 1) + { + for (int i = 0; i < this->registered_colors.size(); ++i) + { + this->registered_colors[i].area_thresh = area_thresh[0]; + } + } + else + { + for (int i = 0; i < this->registered_colors.size(); ++i) + { + this->registered_colors[i].area_thresh = area_thresh[i]; + } + } + return *this; + } + + /** + * @brief Set the area thresh object + * + * @param area_thresh the area thresh for each registered colors + * @param id index of the registered color + * @return ColorDetector& + */ + ColorDetector &set_area_thresh(int area_thresh, int id) + { + assert((id >= 0) && (id < this->registered_colors.size())); + this->registered_colors[id].area_thresh = area_thresh; + return *this; + } + + /** + * @brief Set the bgr object + * + * @param bgr + * @return ColorDetector& + */ + ColorDetector &set_bgr(bool bgr) + { + this->bgr = bgr; + return *this; + } + + /** + * @brief Get the bgr object + * + * @return bool bgr flag + */ + bool get_bgr() + { + return this->bgr; + } + + /** + * @brief Get the detection shape object + * + * @return std::vector + */ + std::vector get_detection_shape() + { + return this->detection_shape; + } + + /** + * @brief Set the detection shape object + * + * @param detection_shape the inference shape of images, the input image will be resized to this shape + * @return ColorDetector& + */ + ColorDetector &set_detection_shape(std::vector detection_shape) + { + assert(detection_shape.size() == 3); + this->detection_shape = detection_shape; + return *this; + } + + /** + * @brief Get the registered colors num + * + * @return int the registered colors num + */ + int get_registered_colors_num() + { + return this->registered_colors.size(); + } + + /** + * @brief print the detection detection results + * + * @param tag + */ + void print_detection_results(const char *tag = "RGB") + { + printf("\n%s | color detection result:\n", tag); + for (int i = 0; i < this->detection_results.size(); ++i) + { + printf("color %d: detected box :%d\n", i, this->detection_results[i].size()); + for (int j = 0; j < this->detection_results[i].size(); ++j) + { + printf("center: (%d, %d)\n", this->detection_results[i][j].center[0], this->detection_results[i][j].center[1]); + printf("box: (%d, %d), (%d, %d)\n", this->detection_results[i][j].box[0], this->detection_results[i][j].box[1], this->detection_results[i][j].box[2], this->detection_results[i][j].box[3]); + printf("area: %d\n", this->detection_results[i][j].area); + } + printf("\n"); + } + } + + /** + * @brief print the segmentation results + * + * @param tag + */ + void print_segmentation_results(const char *tag = "RGB") + { + printf("\n%s | color segmentation result:\n", tag); + for (int i = 0; i < this->segmentation_results.size(); ++i) + { + printf("color %d: detected box :%d\n", i, this->detection_results[i].size()); + for (int j = 0; j < this->segmentation_results[i].index.size(); ++j) + { + printf("box_index: %d, start col: %d, end col: %d, row: %d, area: %d\n", + this->segmentation_results[i].index[j], this->segmentation_results[i].start_col[j], this->segmentation_results[i].end_col[j], + this->segmentation_results[i].row[j], this->segmentation_results[i].area[j]); + } + printf("\n"); + } + } + + /** + * @brief draw the color segmentation result on the input image + * + * @param image the input RGB image + * @param draw_colors RGB values for each detected colors + * @param draw_backgound draw the background if it is true + * @param background_color RGB values for the background color + */ + void draw_segmentation_results(dl::Tensor &image, std::vector> draw_colors, bool draw_backgound = true, std::vector background_color = {0, 0, 0}); + + /** + * @brief draw the color segmentation result on the input image + * + * @param image the pointer of the input RGB565 image + * @param image_shape the shape of the input image + * @param draw_colors RGB565 values for each detected colors + * @param draw_backgound draw the background if it is true + * @param background_color RGB565 values for the background color + */ + void draw_segmentation_results(uint16_t *image, std::vector image_shape, std::vector draw_colors, bool draw_backgound = true, uint16_t background_color = 0x0000); }; \ No newline at end of file diff --git a/tools/sdk/esp32/include/esp-face/include/model_zoo/face_recognition_tool.hpp b/tools/sdk/esp32/include/esp-face/include/model_zoo/face_recognition_tool.hpp index 2226d32daf9..3adf1f62f72 100644 --- a/tools/sdk/esp32/include/esp-face/include/model_zoo/face_recognition_tool.hpp +++ b/tools/sdk/esp32/include/esp-face/include/model_zoo/face_recognition_tool.hpp @@ -10,6 +10,7 @@ #include #include #include +#include "esp_partition.h" /** * @brief struct of face similarity @@ -45,6 +46,13 @@ class FaceID */ FaceID(int id, dl::Tensor &id_emb, std::string name = ""); + /** + * @brief Construct a new Face ID which is same as input face_id + * + * @param face_id input face_id + */ + FaceID(FaceID &face_id); + /** * @brief Destroy the Face ID object * diff --git a/tools/sdk/esp32/include/esp-face/include/model_zoo/face_recognizer.hpp b/tools/sdk/esp32/include/esp-face/include/model_zoo/face_recognizer.hpp index 864881c984a..0f6b854118b 100644 --- a/tools/sdk/esp32/include/esp-face/include/model_zoo/face_recognizer.hpp +++ b/tools/sdk/esp32/include/esp-face/include/model_zoo/face_recognizer.hpp @@ -148,7 +148,7 @@ class FaceRecognizer * @param name name of the face id. * @return int the face id index of the enrolled embedding. */ - int enroll_id(uint16_t *image_input, std::vector shape, std::vector &landmarks, std::string name=""); + int enroll_id(uint16_t *image_input, std::vector shape, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id @@ -158,9 +158,11 @@ class FaceRecognizer * @param aligned_face the Tensor to store the intermeidate aligned face. * @param landmarks face landmarks coordinates * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(uint16_t *image_input, std::vector shape, Tensor &aligned_face, std::vector &landmarks, std::string name=""); + int enroll_id(uint16_t *image_input, std::vector shape, Tensor &aligned_face, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id @@ -168,9 +170,11 @@ class FaceRecognizer * @param image_input the Tensor of input image with format bgr888. * @param landmarks face landmarks coordinates * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &image_input, std::vector &landmarks, std::string name=""); + int enroll_id(Tensor &image_input, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id @@ -179,42 +183,114 @@ class FaceRecognizer * @param aligned_face the Tensor to store the intermeidate aligned face. * @param landmarks face landmarks coordinates * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &image_input, Tensor &aligned_face, std::vector &landmarks, std::string name=""); + int enroll_id(Tensor &image_input, Tensor &aligned_face, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id * * @param aligned_face the Tensor of the input aligned face with format bgr888. * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &aligned_face, std::string name=""); + int enroll_id(Tensor &aligned_face, std::string name="", bool update_flash = false); /** * @brief enroll the normalzied face embedding. * - * @param emb the normalized face embbeding. - * @param name name of the face id. - * @return int the face id index of the enrolled embedding. + * @param emb the normalized face embbeding. + * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash + * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &emb, std::string name=""); + int enroll_id(Tensor &emb, std::string name="", bool update_flash = false); /** - * @brief delete the last enrolled face id. + * @brief delete the last enrolled face id. + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash * * @return int the number of remained face ids. * if the face ids list is empty, return -1 */ - int delete_id(); + int delete_id(bool update_flash = false); /** - * @brief delete the face id with id index. + * @brief delete the face id with id index. * - * @param id face id index. - * @return int the number of remained face ids. - * if there is no matched id return -1 + * @param id face id index. + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash + * @return int the number of remained face ids. + * if there is no matched id return -1 + */ + int delete_id(int id, bool update_flash = false); + + /** + * @brief Set the enrolled ids + * + * @param ids the ids to be set + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash + * @return int the number of enrolled ids. + */ + int set_ids(std::vector *> &ids, bool update_flash = false); + + /** + * @brief Set the enrolled ids from flash + * + * @return int the number of enrolled ids. + */ + int set_ids_from_flash(); + + /** + * @brief write the enrolled ids to flash + * + * @return int the number of enrolled ids. */ - int delete_id(int id); + int write_ids_to_flash(); + + /** + * @brief Get the enrolled ids with name object + * + * @param name + * @return std::vector + */ + std::vector get_enrolled_ids_with_name(std::string name); + + /** + * @brief Check whether the Flash partition is available + * + * @return int -2: the partition has not been set + * -1: the data in the flash does not match the current model. + * model_check_code: the Flash partition is available. + * number of ids in flash: The IDs in Flash and RAM does not sync. + */ + int check_partition(); + + /** + * @brief delete all the enrolled face ids. + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash + * + */ + void clear_id(bool update_flash = false); + + /** + * @brief Set the partition for saving face ids to flash or reading face ids from flash. + * + * @param type esp_partition_type + * @param subtype esp_partition_subtype + * @param label the partition label + * @return int 0: set the partition failed + * 1: set the partition successfully + */ + int set_partition(esp_partition_type_t type, esp_partition_subtype_t subtype, const char *label); + }; \ No newline at end of file diff --git a/tools/sdk/esp32/include/esp-face/include/typedef/dl_constant.hpp b/tools/sdk/esp32/include/esp-face/include/typedef/dl_constant.hpp index 07b2dd24ee1..a111817e3d6 100644 --- a/tools/sdk/esp32/include/esp-face/include/typedef/dl_constant.hpp +++ b/tools/sdk/esp32/include/esp-face/include/typedef/dl_constant.hpp @@ -2,6 +2,7 @@ #include "dl_define.hpp" #include +#include namespace dl { @@ -48,10 +49,11 @@ namespace dl /**/ std::vector shape_with_dilation; /**/ /**/ - std::vector channel_exponent; /**/ + const int8_t* channel_exponent; /**/ + const int channel_exponent_size; /** - * @brief Construct a new Filter object. + * @brief Construct a new Filter object. * * @param element point to element * @param exponent exponent of element @@ -66,16 +68,17 @@ namespace dl Filter(const T *element, const int exponent, const std::vector shape, const std::vector dilation = {1, 1}); /** - * @brief Construct a new Filter object. + * @brief Construct a new Filter object. it is only avaliable to int16_t * - * @param element point to element - * @param channel_exponent exponent for per-channel - * @param shape shape of element - * @param dilation dilation of Filter - * - 1D: reserved - * - 2D: [dilation_in_height, dilation_in_width] + * @param element point to element + * @param channel_exponent exponent for per-channel + * @param channel_exponent_size size of exponent + * @param shape shape of element + * @param dilation dilation of Filter + * - 1D: reserved + * - 2D: [dilation_in_height, dilation_in_width] */ - Filter(const T *element, const std::vector channel_exponent, const std::vector shape, const std::vector dilation = {1, 1}); + Filter(const T *element, const int8_t* channel_exponent, const int channel_exponent_size, const std::vector shape, const std::vector dilation = {1, 1}); /** * @brief Print the n-th filter. @@ -98,9 +101,6 @@ namespace dl { public: using Constant::Constant; - std::vector channel_exponent; /**/ - - Bias(const T *element, const std::vector channel_exponent, const std::vector shape); }; /** diff --git a/tools/sdk/esp32/include/esp-face/include/typedef/dl_variable.hpp b/tools/sdk/esp32/include/esp-face/include/typedef/dl_variable.hpp index 471b3028f1a..118f6430575 100644 --- a/tools/sdk/esp32/include/esp-face/include/typedef/dl_variable.hpp +++ b/tools/sdk/esp32/include/esp-face/include/typedef/dl_variable.hpp @@ -396,9 +396,6 @@ namespace dl * @brief print all the element of the Tensor. * * @param message to print - * @param with_padding one of true or false, - * - true: the padding element will also be ed - * - false: the padding element will not be ed */ void print_all(const char *message = "") { @@ -553,4 +550,4 @@ namespace dl return output; } }; -} // namespace dl \ No newline at end of file +} // namespace dl diff --git a/tools/sdk/esp32/include/esp_http_client/include/esp_http_client.h b/tools/sdk/esp32/include/esp_http_client/include/esp_http_client.h index 820c4168f66..d1b530a42e3 100644 --- a/tools/sdk/esp32/include/esp_http_client/include/esp_http_client.h +++ b/tools/sdk/esp32/include/esp_http_client/include/esp_http_client.h @@ -344,6 +344,17 @@ esp_err_t esp_http_client_set_password(esp_http_client_handle_t client, const ch */ esp_err_t esp_http_client_set_authtype(esp_http_client_handle_t client, esp_http_client_auth_type_t auth_type); +/** + * @brief Get HTTP client session errno + * + * @param[in] client The esp_http_client handle + * + * @return + * - (-1) if invalid argument + * - errno + */ +int esp_http_client_get_errno(esp_http_client_handle_t client); + /** * @brief Set http request method * diff --git a/tools/sdk/esp32/include/esp_hw_support/include/soc/spinlock.h b/tools/sdk/esp32/include/esp_hw_support/include/soc/spinlock.h index 97cc9e514ab..fbeff5054b4 100644 --- a/tools/sdk/esp32/include/esp_hw_support/include/soc/spinlock.h +++ b/tools/sdk/esp32/include/esp_hw_support/include/soc/spinlock.h @@ -52,6 +52,15 @@ static inline void __attribute__((always_inline)) spinlock_initialize(spinlock_t /** * @brief Top level spinlock acquire function, spins until get the lock + * + * This function will: + * - Save current interrupt state, then disable interrupts + * - Spin until lock is acquired or until timeout occurs + * - Restore interrupt state + * + * @note Spinlocks alone do no constitute true critical sections (as this + * function reenables interrupts once the spinlock is acquired). For critical + * sections, use the interface provided by the operating system. * @param lock - target spinlock object * @param timeout - cycles to wait, passing SPINLOCK_WAIT_FOREVER blocs indefinitely */ @@ -125,6 +134,15 @@ static inline bool __attribute__((always_inline)) spinlock_acquire(spinlock_t *l /** * @brief Top level spinlock unlock function, unlocks a previously locked spinlock + * + * This function will: + * - Save current interrupt state, then disable interrupts + * - Release the spinlock + * - Restore interrupt state + * + * @note Spinlocks alone do no constitute true critical sections (as this + * function reenables interrupts once the spinlock is acquired). For critical + * sections, use the interface provided by the operating system. * @param lock - target, locked before, spinlock object */ static inline void __attribute__((always_inline)) spinlock_release(spinlock_t *lock) diff --git a/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_commands.h b/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_commands.h new file mode 100644 index 00000000000..091ef1cffef --- /dev/null +++ b/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_commands.h @@ -0,0 +1,54 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once + +/* Common LCD panel commands */ +#define LCD_CMD_NOP 0x00 // This command is empty command +#define LCD_CMD_SWRESET 0x01 // Software reset registers (the built-in frame buffer is not affected) +#define LCD_CMD_RDDID 0x04 // Read 24-bit display ID +#define LCD_CMD_RDDST 0x09 // Read display status +#define LCD_CMD_RDDPM 0x0A // Read display power mode +#define LCD_CMD_RDD_MADCTL 0x0B // Read display MADCTL +#define LCD_CMD_RDD_COLMOD 0x0C // Read display pixel format +#define LCD_CMD_RDDIM 0x0D // Read display image mode +#define LCD_CMD_RDDSM 0x0E // Read display signal mode +#define LCD_CMD_RDDSR 0x0F // Read display self-diagnostic result +#define LCD_CMD_SLPIN 0x10 // Go into sleep mode (DC/DC, oscillator, scanning stopped, but memory keeps content) +#define LCD_CMD_SLPOUT 0x11 // Exit sleep mode +#define LCD_CMD_PTLON 0x12 // Turns on partial display mode +#define LCD_CMD_NORON 0x13 // Turns on normal display mode +#define LCD_CMD_INVOFF 0x20 // Recover from display inversion mode +#define LCD_CMD_INVON 0x21 // Go into display inversion mode +#define LCD_CMD_GAMSET 0x26 // Select Gamma curve for current display +#define LCD_CMD_DISPOFF 0x28 // Display off (disable frame buffer output) +#define LCD_CMD_DISPON 0x29 // Display on (enable frame buffer output) +#define LCD_CMD_CASET 0x2A // Set column address +#define LCD_CMD_RASET 0x2B // Set row address +#define LCD_CMD_RAMWR 0x2C // Write frame memory +#define LCD_CMD_RAMRD 0x2E // Read frame memory +#define LCD_CMD_PTLAR 0x30 // Define the partial area +#define LCD_CMD_VSCRDEF 0x33 // Vertical scrolling definition +#define LCD_CMD_TEOFF 0x34 // Turns of tearing effect +#define LCD_CMD_TEON 0x35 // Turns on tearing effect + +#define LCD_CMD_MADCTL 0x36 // Memory data access control +#define LCD_CMD_MH_BIT (1 << 2) // Display data latch order, 0: refresh left to right, 1: refresh right to left +#define LCD_CMD_BGR_BIT (1 << 3) // RGB/BGR order, 0: RGB, 1: BGR +#define LCD_CMD_ML_BIT (1 << 4) // Line address order, 0: refresh top to bottom, 1: refresh bottom to top +#define LCD_CMD_MV_BIT (1 << 5) // Row/Column order, 0: normal mode, 1: reverse mode +#define LCD_CMD_MX_BIT (1 << 6) // Column address order, 0: left to right, 1: right to left +#define LCD_CMD_MY_BIT (1 << 7) // Row address order, 0: top to bottom, 1: bottom to top + +#define LCD_CMD_VSCSAD 0x37 // Vertical scroll start address +#define LCD_CMD_IDMOFF 0x38 // Recover from IDLE mode +#define LCD_CMD_IDMON 0x39 // Fall into IDLE mode (8 color depth is displayed) +#define LCD_CMD_COLMOD 0x3A // Defines the format of RGB picture data +#define LCD_CMD_RAMWRC 0x3C // Memory write continue +#define LCD_CMD_RAMRDC 0x3E // Memory read continue +#define LCD_CMD_STE 0x44 // Set tear scanline, tearing effect output signal when display module reaches line N +#define LCD_CMD_GDCAN 0x45 // Get scanline +#define LCD_CMD_WRDISBV 0x51 // Write display brightness +#define LCD_CMD_RDDISBV 0x52 // Read display brightness value diff --git a/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_rgb.h b/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_rgb.h index 1368bb787f6..0c264545ee2 100644 --- a/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_rgb.h +++ b/tools/sdk/esp32/include/esp_lcd/include/esp_lcd_panel_rgb.h @@ -18,10 +18,10 @@ extern "C" { #if SOC_LCD_RGB_SUPPORTED /** * @brief LCD RGB timing structure - * + * @verbatim * Total Width * <---------------------------------------------------> - * Hsync width HBP Active Width HFP + * HSYNC width HBP Active Width HFP * <---><--><--------------------------------------><---> * ____ ____|_______________________________________|____| * |___| | | | @@ -36,7 +36,7 @@ extern "C" { * | /|\ | | / / / / / / / / / / / / / / / / / / / | | * | | | |/ / / / / / / / / / / / / / / / / / / /| | * Total | | | |/ / / / / / / / / / / / / / / / / / / /| | - * Heigh | | | |/ / / / / / / / / / / / / / / / / / / /| | + * Height | | | |/ / / / / / / / / / / / / / / / / / / /| | * |Active| | |/ / / / / / / / / / / / / / / / / / / /| | * |Heigh | | |/ / / / / / Active Display Area / / / /| | * | | | |/ / / / / / / / / / / / / / / / / / / /| | @@ -48,7 +48,7 @@ extern "C" { * | /|\ | | * | VFP | | | * \|/ \|/_____|______________________________________________________| - * + * @endverbatim */ typedef struct { unsigned int pclk_hz; /*!< Frequency of pixel clock */ @@ -65,7 +65,7 @@ typedef struct { unsigned int vsync_idle_low: 1; /*!< The vsync signal is low in IDLE state */ unsigned int de_idle_high: 1; /*!< The de signal is high in IDLE state */ unsigned int pclk_active_neg: 1; /*!< The display will write data lines when there's a falling edge on PCLK */ - unsigned int pclk_idle_low: 1; /*!< The PCLK stays at low level in IDLE phase */ + unsigned int pclk_idle_high: 1; /*!< The PCLK stays at high level in IDLE phase */ } flags; } esp_lcd_rgb_timing_t; diff --git a/tools/sdk/esp32/include/esp_netif/include/esp_netif_defaults.h b/tools/sdk/esp32/include/esp_netif/include/esp_netif_defaults.h index da01500db1c..b8276068e9a 100644 --- a/tools/sdk/esp32/include/esp_netif/include/esp_netif_defaults.h +++ b/tools/sdk/esp32/include/esp_netif/include/esp_netif_defaults.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_NETIF_DEFAULTS_H #define _ESP_NETIF_DEFAULTS_H @@ -37,6 +29,7 @@ extern "C" { .route_prio = 100 \ } \ +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT #define ESP_NETIF_INHERENT_DEFAULT_WIFI_AP() \ { \ .flags = (esp_netif_flags_t)(ESP_NETIF_DHCP_SERVER | ESP_NETIF_FLAG_AUTOUP), \ @@ -48,6 +41,7 @@ extern "C" { .if_desc = "ap", \ .route_prio = 10 \ }; +#endif #define ESP_NETIF_INHERENT_DEFAULT_ETH() \ { \ @@ -108,6 +102,7 @@ extern "C" { .stack = ESP_NETIF_NETSTACK_DEFAULT_ETH, \ } +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT /** * @brief Default configuration reference of WIFI AP */ @@ -117,6 +112,7 @@ extern "C" { .driver = NULL, \ .stack = ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP, \ } +#endif /** * @brief Default configuration reference of WIFI STA @@ -154,10 +150,12 @@ extern "C" { */ #define ESP_NETIF_BASE_DEFAULT_WIFI_STA &_g_esp_netif_inherent_sta_config +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT /** * @brief Default base config (esp-netif inherent) of WIFI AP */ #define ESP_NETIF_BASE_DEFAULT_WIFI_AP &_g_esp_netif_inherent_ap_config +#endif /** * @brief Default base config (esp-netif inherent) of ethernet interface @@ -177,7 +175,9 @@ extern "C" { #define ESP_NETIF_NETSTACK_DEFAULT_ETH _g_esp_netif_netstack_default_eth #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA _g_esp_netif_netstack_default_wifi_sta +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP _g_esp_netif_netstack_default_wifi_ap +#endif #define ESP_NETIF_NETSTACK_DEFAULT_PPP _g_esp_netif_netstack_default_ppp #define ESP_NETIF_NETSTACK_DEFAULT_SLIP _g_esp_netif_netstack_default_slip #define ESP_NETIF_NETSTACK_DEFAULT_OPENTHREAD _g_esp_netif_netstack_default_openthread @@ -190,7 +190,9 @@ extern "C" { // extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_eth; extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_sta; +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_ap; +#endif extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_ppp; extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_slip; @@ -200,12 +202,16 @@ extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_slip; // common behavioural patterns for common interfaces such as STA, AP, ETH, PPP // extern const esp_netif_inherent_config_t _g_esp_netif_inherent_sta_config; +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ap_config; +#endif extern const esp_netif_inherent_config_t _g_esp_netif_inherent_eth_config; extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ppp_config; extern const esp_netif_inherent_config_t _g_esp_netif_inherent_slip_config; +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT extern const esp_netif_ip_info_t _g_esp_netif_soft_ap_ip; +#endif #if CONFIG_OPENTHREAD_ENABLED /** diff --git a/tools/sdk/esp32/include/esp_netif/include/esp_netif_types.h b/tools/sdk/esp32/include/esp_netif/include/esp_netif_types.h index b302e49e3ad..cc7a37b9c49 100644 --- a/tools/sdk/esp32/include/esp_netif/include/esp_netif_types.h +++ b/tools/sdk/esp32/include/esp_netif/include/esp_netif_types.h @@ -79,6 +79,8 @@ typedef enum{ ESP_NETIF_REQUESTED_IP_ADDRESS = 50, /**< Request specific IP address */ ESP_NETIF_IP_ADDRESS_LEASE_TIME = 51, /**< Request IP address lease time */ ESP_NETIF_IP_REQUEST_RETRY_TIME = 52, /**< Request IP address retry counter */ + ESP_NETIF_VENDOR_CLASS_IDENTIFIER = 60, /**< Vendor Class Identifier of a DHCP client */ + ESP_NETIF_VENDOR_SPECIFIC_INFO = 43, /**< Vendor Specific Information of a DHCP server */ } esp_netif_dhcp_option_id_t; /** IP event declarations */ diff --git a/tools/sdk/esp32/include/esp_phy/include/phy.h b/tools/sdk/esp32/include/esp_phy/include/phy.h index 1d0690f3562..e6aa21db50e 100644 --- a/tools/sdk/esp32/include/esp_phy/include/phy.h +++ b/tools/sdk/esp32/include/esp_phy/include/phy.h @@ -68,6 +68,13 @@ void phy_close_rf(void); void phy_xpd_tsens(void); #endif +#if CONFIG_IDF_TARGET_ESP32C3 +/** + * @brief Update internal state of PHY when wifi deinit powers off the wifi power domain. + */ +void phy_init_flag(void); +#endif + /** * @brief Store and load PHY digital registers. * diff --git a/tools/sdk/esp32/include/esp_timer/include/esp_timer.h b/tools/sdk/esp32/include/esp_timer/include/esp_timer.h index 8c942989477..eb4c6d707ab 100644 --- a/tools/sdk/esp32/include/esp_timer/include/esp_timer.h +++ b/tools/sdk/esp32/include/esp_timer/include/esp_timer.h @@ -1,16 +1,8 @@ -// Copyright 2017 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -83,11 +75,28 @@ typedef struct { bool skip_unhandled_events; //!< Skip unhandled events for periodic timers } esp_timer_create_args_t; + +/** + * @brief Minimal initialization of esp_timer + * + * @note This function is called from startup code. Applications do not need + * to call this function before using other esp_timer APIs. + * + * This function can be called very early in startup process, after this call + * only esp_timer_get_time function can be used. + * + * @return + * - ESP_OK on success + */ +esp_err_t esp_timer_early_init(void); + /** * @brief Initialize esp_timer library * * @note This function is called from startup code. Applications do not need * to call this function before using other esp_timer APIs. + * Before calling this function, esp_timer_early_init must be called by the + * startup code. * * @return * - ESP_OK on success diff --git a/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi_os_adapter.h b/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi_os_adapter.h index b583e916267..88d0ee54029 100644 --- a/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi_os_adapter.h +++ b/tools/sdk/esp32/include/esp_wifi/include/esp_private/wifi_os_adapter.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef ESP_WIFI_OS_ADAPTER_H_ #define ESP_WIFI_OS_ADAPTER_H_ diff --git a/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h b/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h index 51e03234841..2d671591765 100644 --- a/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h +++ b/tools/sdk/esp32/include/esp_wifi/include/esp_wifi.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /* Notes about WiFi Programming @@ -275,7 +267,7 @@ esp_err_t esp_wifi_deinit(void); * @brief Set the WiFi operating mode * * Set the WiFi operating mode as station, soft-AP or station+soft-AP, - * The default mode is soft-AP mode. + * The default mode is station mode. * * @param mode WiFi operating mode * diff --git a/tools/sdk/esp32/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h b/tools/sdk/esp32/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h index 675af141ebc..aa87e1b4db2 100644 --- a/tools/sdk/esp32/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h +++ b/tools/sdk/esp32/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h @@ -166,10 +166,19 @@ #define configSTACK_OVERHEAD_APPTRACE 0 #endif +/* Stack watchpoint decreases minimum usable stack size by up to 60 bytes. + See FreeRTOS FREERTOS_WATCHPOINT_END_OF_STACK option in Kconfig. */ +#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK +#define configSTACK_OVERHEAD_WATCHPOINT 60 +#else +#define configSTACK_OVERHEAD_WATCHPOINT 0 +#endif + #define configSTACK_OVERHEAD_TOTAL ( \ configSTACK_OVERHEAD_CHECKER + \ configSTACK_OVERHEAD_OPTIMIZATION + \ - configSTACK_OVERHEAD_APPTRACE \ + configSTACK_OVERHEAD_APPTRACE + \ + configSTACK_OVERHEAD_WATCHPOINT \ ) #define configMINIMAL_STACK_SIZE (768 + configSTACK_OVERHEAD_TOTAL) diff --git a/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h b/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h index 47187379c6c..934f056816c 100644 --- a/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h +++ b/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro.h @@ -155,15 +155,20 @@ void vPortAssertIfInISR(void); BaseType_t xPortInterruptedFromISRContext(void); /** - * @brief Disable interrupts in a nested manner + * @brief Disable interrupts in a nested manner (meant to be called from ISRs) * - * - Cleaner solution allows nested interrupts disabling and restoring via local registers or stack. - * - They can be called from interrupts too. - * - WARNING Only applies to current CPU. - * @note [refactor-todo] Define this as portSET_INTERRUPT_MASK_FROM_ISR() instead - * @return unsigned Previous interrupt state + * @warning Only applies to current CPU. + * @return UBaseType_t Previous interrupt level */ -static inline unsigned __attribute__((always_inline)) portENTER_CRITICAL_NESTED(void); +static inline UBaseType_t xPortSetInterruptMaskFromISR(void); + +/** + * @brief Reenable interrupts in a nested manner (meant to be called from ISRs) + * + * @warning Only applies to current CPU. + * @param prev_level Previous interrupt level + */ +static inline void vPortClearInterruptMaskFromISR(UBaseType_t prev_level); /* ---------------------- Spinlocks ------------------------ * - Modifications made to critical sections to support SMP @@ -174,128 +179,112 @@ static inline unsigned __attribute__((always_inline)) portENTER_CRITICAL_NESTED( * @note [refactor-todo] Check if these comments are still true * ------------------------------------------------------ */ -typedef spinlock_t portMUX_TYPE; /**< Spinlock type used by FreeRTOS critical sections */ -#define portMUX_INITIALIZER_UNLOCKED SPINLOCK_INITIALIZER /**< Spinlock initializer */ -#define portMUX_FREE_VAL SPINLOCK_FREE /**< Spinlock is free. [refactor-todo] check if this is still required */ -#define portMUX_NO_TIMEOUT SPINLOCK_WAIT_FOREVER /**< When passed for 'timeout_cycles', spin forever if necessary. [refactor-todo] check if this is still required */ -#define portMUX_TRY_LOCK SPINLOCK_NO_WAIT /**< Try to acquire the spinlock a single time only. [refactor-todo] check if this is still required */ +typedef spinlock_t portMUX_TYPE; /**< Spinlock type used by FreeRTOS critical sections */ +#define portMUX_INITIALIZER_UNLOCKED SPINLOCK_INITIALIZER /**< Spinlock initializer */ +#define portMUX_FREE_VAL SPINLOCK_FREE /**< Spinlock is free. [refactor-todo] check if this is still required */ +#define portMUX_NO_TIMEOUT SPINLOCK_WAIT_FOREVER /**< When passed for 'timeout_cycles', spin forever if necessary. [refactor-todo] check if this is still required */ +#define portMUX_TRY_LOCK SPINLOCK_NO_WAIT /**< Try to acquire the spinlock a single time only. [refactor-todo] check if this is still required */ +#define portMUX_INITIALIZE(mux) spinlock_initialize(mux) /*< Initialize a spinlock to its unlocked state */ -/** - * @brief Initialize a spinlock - * - * - Initializes a spinlock that is used by FreeRTOS SMP critical sections - * - * @param[in] mux Spinlock - */ -static inline void __attribute__((always_inline)) vPortCPUInitializeMutex(portMUX_TYPE *mux); +// ------------------ Critical Sections -------------------- /** - * @brief Acquire a spinlock + * @brief Enter a SMP critical section with a timeout * - * @note [refactor-todo] check if we still need this - * - * @param[in] mux Spinlock - */ -static inline void __attribute__((always_inline)) vPortCPUAcquireMutex(portMUX_TYPE *mux); - -/** - * @brief Acquire a spinlock but with a specified timeout + * This function enters an SMP critical section by disabling interrupts then + * taking a spinlock with a specified timeout. * - * @note [refactor-todo] check if we still need this - * @note [refactor-todo] Check if this function should be renamed (due to bool return type) + * This function can be called in a nested manner. * - * @param[in] mux Spinlock - * @param timeout - * @return true Spinlock acquired - * @return false Timed out + * @note This function is made non-inline on purpose to reduce code size + * @param mux Spinlock + * @param timeout Timeout to wait for spinlock in number of CPU cycles. + * Use portMUX_NO_TIMEOUT to wait indefinitely + * Use portMUX_TRY_LOCK to only getting the spinlock a single time + * @retval pdPASS Critical section entered (spinlock taken) + * @retval pdFAIL If timed out waiting for spinlock (will not occur if using portMUX_NO_TIMEOUT) */ -static inline bool __attribute__((always_inline)) vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout); +BaseType_t xPortEnterCriticalTimeout(portMUX_TYPE *mux, BaseType_t timeout); /** - * @brief Release a spinlock + * @brief Enter a SMP critical section + * + * This function enters an SMP critical section by disabling interrupts then + * taking a spinlock with an unlimited timeout. * - * @note [refactor-todo] check if we still need this + * This function can be called in a nested manner * * @param[in] mux Spinlock */ -static inline void __attribute__((always_inline)) vPortCPUReleaseMutex(portMUX_TYPE *mux); +static inline void __attribute__((always_inline)) vPortEnterCritical(portMUX_TYPE *mux); /** - * @brief Wrapper for atomic compare-and-set instruction + * @brief Exit a SMP critical section * - * This subroutine will atomically compare *addr to 'compare'. If *addr == compare, *addr is set to *set. *set is - * updated with the previous value of *addr (either 'compare' or some other value.) + * This function can be called in a nested manner. On the outer most level of nesting, this function will: * - * @warning From the ISA docs: in some (unspecified) cases, the s32c1i instruction may return the "bitwise inverse" of - * the old mem if the mem wasn't written. This doesn't seem to happen on the ESP32 (portMUX assertions would - * fail). + * - Release the spinlock + * - Restore the previous interrupt level before the critical section was entered * - * @note [refactor-todo] check if we still need this - * @note [refactor-todo] Check if this function should be renamed (due to void return type) + * If still nesting, this function simply decrements a critical nesting count * - * @param[inout] addr Pointer to target address - * @param[in] compare Compare value - * @param[inout] set Pointer to set value + * @note This function is made non-inline on purpose to reduce code size + * @param[in] mux Spinlock */ -static inline void __attribute__((always_inline)) uxPortCompareSet(volatile uint32_t *addr, uint32_t compare, uint32_t *set); +void vPortExitCritical(portMUX_TYPE *mux); /** - * @brief Wrapper for atomic compare-and-set instruction in external RAM + * @brief FreeRTOS Compliant version of xPortEnterCriticalTimeout() * - * Atomic compare-and-set but the target address is placed in external RAM + * Compliant version of xPortEnterCriticalTimeout() will ensure that this is + * called from a task context only. An abort is called otherwise. * - * @note [refactor-todo] check if we still need this + * @note This function is made non-inline on purpose to reduce code size * - * @param[inout] addr Pointer to target address - * @param[in] compare Compare value - * @param[inout] set Pointer to set value + * @param mux Spinlock + * @param timeout Timeout + * @return BaseType_t */ -static inline void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set); - -// ------------------ Critical Sections -------------------- +BaseType_t xPortEnterCriticalTimeoutCompliance(portMUX_TYPE *mux, BaseType_t timeout); /** - * @brief Enter a SMP critical section + * @brief FreeRTOS compliant version of vPortEnterCritical() * - * - Disable interrupts - * - Takes spinlock - * - Can be nested + * Compliant version of vPortEnterCritical() will ensure that this is + * called from a task context only. An abort is called otherwise. * * @param[in] mux Spinlock */ -void vPortEnterCritical(portMUX_TYPE *mux); +static inline void __attribute__((always_inline)) vPortEnterCriticalCompliance(portMUX_TYPE *mux); /** - * @brief Exit a SMP critical section + * @brief FreeRTOS compliant version of vPortExitCritical() * - * - Releases spinlock - * - Reenables interrupts - * - Can be nested + * Compliant version of vPortExitCritical() will ensure that this is + * called from a task context only. An abort is called otherwise. * + * @note This function is made non-inline on purpose to reduce code size * @param[in] mux Spinlock */ -void vPortExitCritical(portMUX_TYPE *mux); +void vPortExitCriticalCompliance(portMUX_TYPE *mux); /** - * @brief FreeRTOS compliant version of enter critical - * - * - Ensures that critical section is only entered from task context + * @brief Safe version of enter critical timeout * - * @param[in] mux Spinlock - */ -static inline void __attribute__((always_inline)) vPortEnterCriticalCompliance(portMUX_TYPE *mux); - -/** - * @brief FreeRTOS compliant version of exit critical + * Safe version of enter critical will automatically select between + * portTRY_ENTER_CRITICAL() and portTRY_ENTER_CRITICAL_ISR() * - * @param[in] mux Spinlock + * @param mux Spinlock + * @param timeout Timeout + * @return BaseType_t */ -static inline void __attribute__((always_inline)) vPortExitCriticalCompliance(portMUX_TYPE *mux); +static inline BaseType_t __attribute__((always_inline)) xPortEnterCriticalTimeoutSafe(portMUX_TYPE *mux, BaseType_t timeout); /** * @brief Safe version of enter critical * - * - This function can be used to enter a critical section from both task and ISR contexts + * Safe version of enter critical will automatically select between + * portENTER_CRITICAL() and portENTER_CRITICAL_ISR() * * @param[in] mux Spinlock */ @@ -304,6 +293,9 @@ static inline void __attribute__((always_inline)) vPortEnterCriticalSafe(portMUX /** * @brief Safe version of exit critical * + * Safe version of enter critical will automatically select between + * portEXIT_CRITICAL() and portEXIT_CRITICAL_ISR() + * * @param[in] mux Spinlock */ static inline void __attribute__((always_inline)) vPortExitCriticalSafe(portMUX_TYPE *mux); @@ -392,6 +384,38 @@ void vPortSetStackWatchpoint( void *pxStackStart ); */ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void); +/** + * @brief Wrapper for atomic compare-and-set instruction + * + * This subroutine will atomically compare *addr to 'compare'. If *addr == compare, *addr is set to *set. *set is + * updated with the previous value of *addr (either 'compare' or some other value.) + * + * @warning From the ISA docs: in some (unspecified) cases, the s32c1i instruction may return the "bitwise inverse" of + * the old mem if the mem wasn't written. This doesn't seem to happen on the ESP32 (portMUX assertions would + * fail). + * + * @note [refactor-todo] Check if this can be deprecated + * @note [refactor-todo] Check if this function should be renamed (due to void return type) + * + * @param[inout] addr Pointer to target address + * @param[in] compare Compare value + * @param[inout] set Pointer to set value + */ +static inline void __attribute__((always_inline)) uxPortCompareSet(volatile uint32_t *addr, uint32_t compare, uint32_t *set); + +/** + * @brief Wrapper for atomic compare-and-set instruction in external RAM + * + * Atomic compare-and-set but the target address is placed in external RAM + * + * @note [refactor-todo] Check if this can be deprecated + * + * @param[inout] addr Pointer to target address + * @param[in] compare Compare value + * @param[inout] set Pointer to set value + */ +static inline void __attribute__((always_inline)) uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set); + /* ------------------------------------------- FreeRTOS Porting Interface ---------------------------------------------- @@ -416,8 +440,6 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void); // --------------------- Interrupts ------------------------ -#define portEXIT_CRITICAL_NESTED(state) do { portbenchmarkINTERRUPT_RESTORE(state); XTOS_RESTORE_JUST_INTLEVEL(state); } while (0) - /** * - Only applies to current core * - These cannot be nested. They should be used with a lot of care and cannot be called from interrupt level. @@ -430,8 +452,8 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void); /** * ISR versions to enable/disable interrupts */ -#define portSET_INTERRUPT_MASK_FROM_ISR() portENTER_CRITICAL_NESTED() -#define portCLEAR_INTERRUPT_MASK_FROM_ISR(state) portEXIT_CRITICAL_NESTED(state) +#define portSET_INTERRUPT_MASK_FROM_ISR() xPortSetInterruptMaskFromISR() +#define portCLEAR_INTERRUPT_MASK_FROM_ISR(prev_level) vPortClearInterruptMaskFromISR(prev_level) #define portASSERT_IF_IN_ISR() vPortAssertIfInISR() @@ -446,16 +468,22 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void); * - Safe versions can be called from either contexts */ #ifdef CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE -#define portENTER_CRITICAL(mux) vPortEnterCriticalCompliance(mux) -#define portEXIT_CRITICAL(mux) vPortExitCriticalCompliance(mux) +#define portTRY_ENTER_CRITICAL(mux, timeout) xPortEnterCriticalTimeoutCompliance(mux, timeout) +#define portENTER_CRITICAL(mux) vPortEnterCriticalCompliance(mux) +#define portEXIT_CRITICAL(mux) vPortExitCriticalCompliance(mux) #else -#define portENTER_CRITICAL(mux) vPortEnterCritical(mux) -#define portEXIT_CRITICAL(mux) vPortExitCritical(mux) +#define portTRY_ENTER_CRITICAL(mux, timeout) xPortEnterCriticalTimeout(mux, timeout) +#define portENTER_CRITICAL(mux) vPortEnterCritical(mux) +#define portEXIT_CRITICAL(mux) vPortExitCritical(mux) #endif /* CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE */ -#define portENTER_CRITICAL_ISR(mux) vPortEnterCritical(mux) -#define portEXIT_CRITICAL_ISR(mux) vPortExitCritical(mux) -#define portENTER_CRITICAL_SAFE(mux) vPortEnterCriticalSafe(mux) -#define portEXIT_CRITICAL_SAFE(mux) vPortExitCriticalSafe(mux) + +#define portTRY_ENTER_CRITICAL_ISR(mux, timeout) xPortEnterCriticalTimeout(mux, timeout) +#define portENTER_CRITICAL_ISR(mux) vPortEnterCritical(mux) +#define portEXIT_CRITICAL_ISR(mux) vPortExitCritical(mux) + +#define portTRY_ENTER_CRITICAL_SAFE(mux, timeout) xPortEnterCriticalTimeoutSafe(mux) +#define portENTER_CRITICAL_SAFE(mux) vPortEnterCriticalSafe(mux) +#define portEXIT_CRITICAL_SAFE(mux) vPortExitCriticalSafe(mux) // ---------------------- Yielding ------------------------- @@ -530,78 +558,45 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void); // --------------------- Interrupts ------------------------ -static inline unsigned portENTER_CRITICAL_NESTED(void) +static inline UBaseType_t xPortSetInterruptMaskFromISR(void) { - unsigned state = XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL); + UBaseType_t prev_int_level = XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL); portbenchmarkINTERRUPT_DISABLE(); - return state; -} - -// ---------------------- Spinlocks ------------------------ - -static inline void __attribute__((always_inline)) vPortCPUInitializeMutex(portMUX_TYPE *mux) -{ - spinlock_initialize(mux); -} - -static inline void __attribute__((always_inline)) vPortCPUAcquireMutex(portMUX_TYPE *mux) -{ - spinlock_acquire(mux, portMUX_NO_TIMEOUT); + return prev_int_level; } -static inline bool __attribute__((always_inline)) vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout) +static inline void vPortClearInterruptMaskFromISR(UBaseType_t prev_level) { - return (spinlock_acquire(mux, timeout)); + portbenchmarkINTERRUPT_RESTORE(prev_level); + XTOS_RESTORE_JUST_INTLEVEL(prev_level); } -static inline void __attribute__((always_inline)) vPortCPUReleaseMutex(portMUX_TYPE *mux) -{ - spinlock_release(mux); -} - -static inline void __attribute__((always_inline)) uxPortCompareSet(volatile uint32_t *addr, uint32_t compare, uint32_t *set) -{ - compare_and_set_native(addr, compare, set); -} +// ------------------ Critical Sections -------------------- -static inline void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set) +static inline void __attribute__((always_inline)) vPortEnterCritical(portMUX_TYPE *mux) { -#ifdef CONFIG_SPIRAM - compare_and_set_extram(addr, compare, set); -#endif + xPortEnterCriticalTimeout(mux, portMUX_NO_TIMEOUT); } -// ------------------ Critical Sections -------------------- - static inline void __attribute__((always_inline)) vPortEnterCriticalCompliance(portMUX_TYPE *mux) { - if (!xPortInIsrContext()) { - vPortEnterCritical(mux); - } else { - esp_rom_printf("%s:%d (%s)- port*_CRITICAL called from ISR context!\n", - __FILE__, __LINE__, __FUNCTION__); - abort(); - } + xPortEnterCriticalTimeoutCompliance(mux, portMUX_NO_TIMEOUT); } -static inline void __attribute__((always_inline)) vPortExitCriticalCompliance(portMUX_TYPE *mux) +static inline BaseType_t __attribute__((always_inline)) xPortEnterCriticalTimeoutSafe(portMUX_TYPE *mux, BaseType_t timeout) { - if (!xPortInIsrContext()) { - vPortExitCritical(mux); + BaseType_t ret; + if (xPortInIsrContext()) { + ret = portTRY_ENTER_CRITICAL_ISR(mux, timeout); } else { - esp_rom_printf("%s:%d (%s)- port*_CRITICAL called from ISR context!\n", - __FILE__, __LINE__, __FUNCTION__); - abort(); + ret = portTRY_ENTER_CRITICAL(mux, timeout); } + return ret; } static inline void __attribute__((always_inline)) vPortEnterCriticalSafe(portMUX_TYPE *mux) { - if (xPortInIsrContext()) { - portENTER_CRITICAL_ISR(mux); - } else { - portENTER_CRITICAL(mux); - } + xPortEnterCriticalTimeoutSafe(mux, portMUX_NO_TIMEOUT); } static inline void __attribute__((always_inline)) vPortExitCriticalSafe(portMUX_TYPE *mux) @@ -639,6 +634,18 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void) return (uint32_t) cpu_hal_get_core_id(); } +static inline void __attribute__((always_inline)) uxPortCompareSet(volatile uint32_t *addr, uint32_t compare, uint32_t *set) +{ + compare_and_set_native(addr, compare, set); +} + +static inline void __attribute__((always_inline)) uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set) +{ +#ifdef CONFIG_SPIRAM + compare_and_set_extram(addr, compare, set); +#endif +} + /* ------------------------------------------------------ Misc --------------------------------------------------------- @@ -737,6 +744,14 @@ bool xPortcheckValidStackMem(const void *ptr); #define portVALID_TCB_MEM(ptr) xPortCheckValidTCBMem(ptr) #define portVALID_STACK_MEM(ptr) xPortcheckValidStackMem(ptr) + + +/* ---------------------------------------------------- Deprecate ------------------------------------------------------ + * - Pull in header containing deprecated macros here + * ------------------------------------------------------------------------------------------------------------------ */ + +#include "portmacro_deprecated.h" + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro_deprecated.h b/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro_deprecated.h new file mode 100644 index 00000000000..378617c73aa --- /dev/null +++ b/tools/sdk/esp32/include/freertos/port/xtensa/include/freertos/portmacro_deprecated.h @@ -0,0 +1,93 @@ +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* ---------------------------------------------------- Deprecate ------------------------------------------------------ + * - Macros or functions that should be deprecated in v5.0, then removed in the next major release + * - Kept as not to cause a breaking change + * - Include this header at the end of portmacro.h + * ------------------------------------------------------------------------------------------------------------------ */ + +/** + * @brief Disable interrupts in a nested manner + * + * Does the exact same thing as portSET_INTERRUPT_MASK_FROM_ISR() + * + * @deprecated This function is deprecated. Call portSET_INTERRUPT_MASK_FROM_ISR() instead + */ +static inline __attribute__((deprecated)) UBaseType_t portENTER_CRITICAL_NESTED(void) { + return portSET_INTERRUPT_MASK_FROM_ISR(); +} + +/** + * @brief Reenables interrupts in a nested manner + * + * Does the exact same thing as portCLEAR_INTERRUPT_MASK_FROM_ISR() + * + * @deprecated This function is deprecated. Call portCLEAR_INTERRUPT_MASK_FROM_ISR() instead + */ +static inline void __attribute__((deprecated)) portEXIT_CRITICAL_NESTED(UBaseType_t prev_level) +{ + portCLEAR_INTERRUPT_MASK_FROM_ISR(prev_level); +} + +/* ---------------------- Spinlocks --------------------- */ + +/** + * @brief Initialize a spinlock + * + * Does the exact same thing as spinlock_initialize(); + * + * @deprecated This function is deprecated. Call spinlock_initialize() instead + * @param[in] mux Spinlock + */ +static inline void __attribute__((deprecated)) __attribute__((always_inline)) vPortCPUInitializeMutex(portMUX_TYPE *mux) +{ + spinlock_initialize(mux); +} + +/** + * @brief Acquire a spinlock + * + * Does the exact same thing as spinlock_acquire() with unlimited timeout + * + * @deprecated This function is deprecated. Call spinlock_acquire() instead + * @param[in] mux Spinlock + */ +static inline void __attribute__((deprecated)) __attribute__((always_inline)) vPortCPUAcquireMutex(portMUX_TYPE *mux) +{ + spinlock_acquire(mux, portMUX_NO_TIMEOUT); +} + +/** + * @brief Acquire a spinlock + * + * Does the exact same thing as spinlock_acquire() with a specified timeout + * + * @deprecated This function is deprecated. Call spinlock_acquire() instead + * @note Does not have deprecated attribute due to usage in app_trace_util.c + * @param[in] mux Spinlock + * @param timeout + * @return true Spinlock acquired + * @return false Timed out + */ +static inline bool __attribute__((always_inline)) vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout) +{ + return (spinlock_acquire(mux, timeout)); +} + +/** + * @brief Release a spinlock + * + * Does the exact same thing as spinlock_release() + * + * @deprecated This function is deprecated. Call spinlock_release() instead + * @note Does not have deprecated attribute due to usage in app_trace_util.c + * @param[in] mux Spinlock + */ +static inline void __attribute__((always_inline)) vPortCPUReleaseMutex(portMUX_TYPE *mux) +{ + spinlock_release(mux); +} diff --git a/tools/sdk/esp32/include/hal/esp32/include/hal/gpio_ll.h b/tools/sdk/esp32/include/hal/esp32/include/hal/gpio_ll.h index 2a4b0f05431..59a2858ce91 100644 --- a/tools/sdk/esp32/include/hal/esp32/include/hal/gpio_ll.h +++ b/tools/sdk/esp32/include/hal/esp32/include/hal/gpio_ll.h @@ -239,7 +239,7 @@ static inline void gpio_ll_get_intr_status(gpio_dev_t *hw, uint32_t core_id, uin */ static inline void gpio_ll_get_intr_status_high(gpio_dev_t *hw, uint32_t core_id, uint32_t *status) { - *status = (core_id == 0) ? HAL_FORCE_READ_U32_REG_FIELD(hw->pcpu_int1, intr) : HAL_FORCE_READ_U32_REG_FIELD(hw->pcpu_int1, intr); + *status = (core_id == 0) ? HAL_FORCE_READ_U32_REG_FIELD(hw->pcpu_int1, intr) : HAL_FORCE_READ_U32_REG_FIELD(hw->acpu_int1, intr); } /** diff --git a/tools/sdk/esp32/include/hal/esp32/include/hal/mcpwm_ll.h b/tools/sdk/esp32/include/hal/esp32/include/hal/mcpwm_ll.h index 3e2b4b762c8..44c19c85d76 100644 --- a/tools/sdk/esp32/include/hal/esp32/include/hal/mcpwm_ll.h +++ b/tools/sdk/esp32/include/hal/esp32/include/hal/mcpwm_ll.h @@ -1,16 +1,8 @@ -// Copyright 2015-2021 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /******************************************************************************* * NOTICE @@ -339,17 +331,15 @@ static inline void mcpwm_ll_timer_set_count_mode(mcpwm_dev_t *mcpwm, int timer_i static inline mcpwm_timer_count_mode_t mcpwm_ll_timer_get_count_mode(mcpwm_dev_t *mcpwm, int timer_id) { switch (mcpwm->timer[timer_id].timer_cfg1.timer_mod) { - case 0: - return MCPWM_TIMER_COUNT_MODE_PAUSE; case 1: return MCPWM_TIMER_COUNT_MODE_UP; case 2: return MCPWM_TIMER_COUNT_MODE_DOWN; case 3: return MCPWM_TIMER_COUNT_MODE_UP_DOWN; + case 0: default: - HAL_ASSERT(false && "unknown count mode"); - return mcpwm->timer[timer_id].timer_cfg1.timer_mod; + return MCPWM_TIMER_COUNT_MODE_PAUSE; } } diff --git a/tools/sdk/esp32/include/hal/include/hal/lcd_types.h b/tools/sdk/esp32/include/hal/include/hal/lcd_types.h index 01e6d0c2949..1a62d8f8eb4 100644 --- a/tools/sdk/esp32/include/hal/include/hal/lcd_types.h +++ b/tools/sdk/esp32/include/hal/include/hal/lcd_types.h @@ -13,12 +13,17 @@ extern "C" { /** * @brief LCD clock source * @note User should select the clock source based on the real requirement: - * - * | LCD clock source | Features | Power Management | - * |---------------------|--------------------------|----------------------------| - * | LCD_CLK_SRC_PLL160M | High resolution, fixed | ESP_PM_APB_FREQ_MAX lock | - * | LCD_CLK_SRC_APLL | Configurable resolution | ESP_PM_NO_LIGHT_SLEEP lock | - * | LCD_CLK_SRC_XTAL | Medium resolution, fixed | No PM lock | + * @verbatim embed:rst:leading-asterisk + * +---------------------+-------------------------+----------------------------+ + * | LCD clock source | Features | Power Management | + * +=====================+=========================+============================+ + * | LCD_CLK_SRC_PLL160M | High resolution | ESP_PM_APB_FREQ_MAX lock | + * +---------------------+-------------------------+----------------------------+ + * | LCD_CLK_SRC_APLL | Configurable resolution | ESP_PM_NO_LIGHT_SLEEP lock | + * +---------------------+-------------------------+----------------------------+ + * | LCD_CLK_SRC_XTAL | Medium resolution | No PM lock | + * +---------------------+-------------------------+----------------------------+ + * @endverbatim */ typedef enum { LCD_CLK_SRC_PLL160M, /*!< Select PLL160M as the source clock */ diff --git a/tools/sdk/esp32/include/hal/include/hal/usbh_hal.h b/tools/sdk/esp32/include/hal/include/hal/usbh_hal.h index b315f6c0b14..6360f7b3f36 100644 --- a/tools/sdk/esp32/include/hal/include/hal/usbh_hal.h +++ b/tools/sdk/esp32/include/hal/include/hal/usbh_hal.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -50,17 +42,6 @@ typedef struct { uint32_t ptx_fifo_lines; /**< Size of the Periodic FIFO in terms the number of FIFO lines */ } usbh_hal_fifo_config_t; -// --------------------- HAL States ------------------------ - -/** - * @brief Channel states - */ -typedef enum { - USBH_HAL_CHAN_STATE_HALTED = 0, /**< The channel is halted. No transfer descriptor list is being executed */ - USBH_HAL_CHAN_STATE_ACTIVE, /**< The channel is active. A transfer descriptor list is being executed */ - USBH_HAL_CHAN_STATE_ERROR, /**< The channel is in the error state */ -} usbh_hal_chan_state_t; - // --------------------- HAL Events ------------------------ /** @@ -153,8 +134,7 @@ typedef struct { struct { uint32_t active: 1; /**< Debugging bit to indicate whether channel is enabled */ uint32_t halt_requested: 1; /**< A halt has been requested */ - uint32_t error_pending: 1; /**< The channel is waiting for the error to be handled */ - uint32_t reserved: 1; + uint32_t reserved: 2; uint32_t chan_idx: 4; /**< The index number of the channel */ uint32_t reserved24: 24; }; @@ -556,23 +536,6 @@ static inline void *usbh_hal_chan_get_context(usbh_hal_chan_t *chan_obj) return chan_obj->chan_ctx; } -/** - * @brief Get the current state of a channel - * - * @param chan_obj Channel object - * @return usbh_hal_chan_state_t State of the channel - */ -static inline usbh_hal_chan_state_t usbh_hal_chan_get_state(usbh_hal_chan_t *chan_obj) -{ - if (chan_obj->flags.error_pending) { - return USBH_HAL_CHAN_STATE_ERROR; - } else if (chan_obj->flags.active) { - return USBH_HAL_CHAN_STATE_ACTIVE; - } else { - return USBH_HAL_CHAN_STATE_HALTED; - } -} - /** * @brief Set the endpoint information for a particular channel * @@ -602,7 +565,7 @@ void usbh_hal_chan_set_ep_char(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_ob static inline void usbh_hal_chan_set_dir(usbh_hal_chan_t *chan_obj, bool is_in) { //Cannot change direction whilst channel is still active or in error - HAL_ASSERT(!chan_obj->flags.active && !chan_obj->flags.error_pending); + HAL_ASSERT(!chan_obj->flags.active); usbh_ll_chan_set_dir(chan_obj->regs, is_in); } @@ -621,7 +584,7 @@ static inline void usbh_hal_chan_set_dir(usbh_hal_chan_t *chan_obj, bool is_in) static inline void usbh_hal_chan_set_pid(usbh_hal_chan_t *chan_obj, int pid) { //Cannot change pid whilst channel is still active or in error - HAL_ASSERT(!chan_obj->flags.active && !chan_obj->flags.error_pending); + HAL_ASSERT(!chan_obj->flags.active); //Update channel object and set the register usbh_ll_chan_set_pid(chan_obj->regs, pid); } @@ -638,7 +601,7 @@ static inline void usbh_hal_chan_set_pid(usbh_hal_chan_t *chan_obj, int pid) */ static inline uint32_t usbh_hal_chan_get_pid(usbh_hal_chan_t *chan_obj) { - HAL_ASSERT(!chan_obj->flags.active && !chan_obj->flags.error_pending); + HAL_ASSERT(!chan_obj->flags.active); return usbh_ll_chan_get_pid(chan_obj->regs); } @@ -688,27 +651,33 @@ static inline int usbh_hal_chan_get_qtd_idx(usbh_hal_chan_t *chan_obj) bool usbh_hal_chan_request_halt(usbh_hal_chan_t *chan_obj); /** - * @brief Get a channel's error + * @brief Indicate that a channel is halted after a port error + * + * When a port error occurs (e.g., discconect, overcurrent): + * - Any previously active channels will remain active (i.e., they will not receive a channel interrupt) + * - Attempting to disable them using usbh_hal_chan_request_halt() will NOT generate an interrupt for ISOC channels + * (probalby something to do with the periodic scheduling) + * + * However, the channel's enable bit can be left as 1 since after a port error, a soft reset will be done anyways. + * This function simply updates the channels internal state variable to indicate it is halted (thus allowing it to be + * freed). * * @param chan_obj Channel object - * @return usbh_hal_chan_error_t The type of error the channel has encountered */ -static inline usbh_hal_chan_error_t usbh_hal_chan_get_error(usbh_hal_chan_t *chan_obj) +static inline void usbh_hal_chan_mark_halted(usbh_hal_chan_t *chan_obj) { - HAL_ASSERT(chan_obj->flags.error_pending); - return chan_obj->error; + chan_obj->flags.active = 0; } /** - * @brief Clear a channel of it's error + * @brief Get a channel's error * * @param chan_obj Channel object + * @return usbh_hal_chan_error_t The type of error the channel has encountered */ -static inline void usbh_hal_chan_clear_error(usbh_hal_chan_t *chan_obj) +static inline usbh_hal_chan_error_t usbh_hal_chan_get_error(usbh_hal_chan_t *chan_obj) { - //Can only clear error when an error has occurred - HAL_ASSERT(chan_obj->flags.error_pending); - chan_obj->flags.error_pending = 0; + return chan_obj->error; } // -------------------------------------------- Transfer Descriptor List ----------------------------------------------- diff --git a/tools/sdk/esp32/include/hal/include/hal/usbh_ll.h b/tools/sdk/esp32/include/hal/include/hal/usbh_ll.h index a6c03e302a4..63f7b8219d1 100644 --- a/tools/sdk/esp32/include/hal/include/hal/usbh_ll.h +++ b/tools/sdk/esp32/include/hal/include/hal/usbh_ll.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -23,6 +15,8 @@ extern "C" { #include "soc/usbh_struct.h" #include "soc/usb_wrap_struct.h" #include "hal/usb_types_private.h" +#include "hal/misc.h" + /* ----------------------------------------------------------------------------- ------------------------------- Global Registers ------------------------------- @@ -328,7 +322,7 @@ static inline void usb_ll_dis_intrs(usbh_dev_t *hw, uint32_t intr_mask) static inline void usb_ll_set_rx_fifo_size(usbh_dev_t *hw, uint32_t num_lines) { //Set size in words - hw->grxfsiz_reg.rxfdep = num_lines; + HAL_FORCE_MODIFY_U32_REG_FIELD(hw->grxfsiz_reg, rxfdep, num_lines); } // -------------------------- GNPTXFSIZ Register ------------------------------- @@ -337,8 +331,8 @@ static inline void usb_ll_set_nptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint { usb_gnptxfsiz_reg_t gnptxfsiz; gnptxfsiz.val = hw->gnptxfsiz_reg.val; - gnptxfsiz.nptxfstaddr = addr; - gnptxfsiz.nptxfdep = num_lines; + HAL_FORCE_MODIFY_U32_REG_FIELD(gnptxfsiz, nptxfstaddr, addr); + HAL_FORCE_MODIFY_U32_REG_FIELD(gnptxfsiz, nptxfdep, num_lines); hw->gnptxfsiz_reg.val = gnptxfsiz.val; } @@ -373,8 +367,8 @@ static inline void usbh_ll_set_ptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint { usb_hptxfsiz_reg_t hptxfsiz; hptxfsiz.val = hw->hptxfsiz_reg.val; - hptxfsiz.ptxfstaddr = addr; - hptxfsiz.ptxfsize = num_lines; + HAL_FORCE_MODIFY_U32_REG_FIELD(hptxfsiz, ptxfstaddr, addr); + HAL_FORCE_MODIFY_U32_REG_FIELD(hptxfsiz, ptxfsize, num_lines); hw->hptxfsiz_reg.val = hptxfsiz.val; } @@ -473,7 +467,7 @@ static inline void usbh_ll_hfir_set_defaults(usbh_dev_t *hw, usb_priv_speed_t sp static inline uint32_t usbh_ll_get_frm_time_rem(usbh_dev_t *hw) { - return hw->hfnum_reg.frrem; + return HAL_FORCE_READ_U32_REG_FIELD(hw->hfnum_reg, frrem); } static inline uint32_t usbh_ll_get_frm_num(usbh_dev_t *hw) @@ -485,7 +479,7 @@ static inline uint32_t usbh_ll_get_frm_num(usbh_dev_t *hw) static inline uint32_t usbh_ll_get_p_tx_queue_top(usbh_dev_t *hw) { - return hw->hptxsts_reg.ptxqtop; + return HAL_FORCE_READ_U32_REG_FIELD(hw->hptxsts_reg, ptxqtop); } static inline uint32_t usbh_ll_get_p_tx_queue_space_avail(usbh_dev_t *hw) @@ -495,20 +489,21 @@ static inline uint32_t usbh_ll_get_p_tx_queue_space_avail(usbh_dev_t *hw) static inline uint32_t usbh_ll_get_p_tx_fifo_space_avail(usbh_dev_t *hw) { - return hw->hptxsts_reg.ptxfspcavail; + return HAL_FORCE_READ_U32_REG_FIELD(hw->hptxsts_reg, ptxfspcavail); } // ----------------------------- HAINT Register -------------------------------- static inline uint32_t usbh_ll_get_chan_intrs_msk(usbh_dev_t *hw) { - return hw->haint_reg.haint; + return HAL_FORCE_READ_U32_REG_FIELD(hw->haint_reg, haint); } // --------------------------- HAINTMSK Register ------------------------------- static inline void usbh_ll_haintmsk_en_chan_intr(usbh_dev_t *hw, uint32_t mask) { + hw->haintmsk_reg.val |= mask; } @@ -817,31 +812,6 @@ static inline void usbh_ll_chan_set_dma_addr_non_iso(volatile usb_host_chan_regs chan->hcdma_reg.non_iso.ctd = qtd_idx; } -static inline void usbh_ll_chan_set_dma_addr_iso(volatile usb_host_chan_regs_t *chan, - void *dmaaddr, - uint32_t ntd) -{ - int n; - if (ntd == 2) { - n = 4; - } else if (ntd == 4) { - n = 5; - } else if (ntd == 8) { - n = 6; - } else if (ntd == 16) { - n = 7; - } else if (ntd == 32) { - n = 8; - } else { //ntd == 64 - n = 9; - } - //Set HCTSIZi - chan->hctsiz_reg.ntd = ntd -1; - chan->hctsiz_reg.sched_info = 0xFF; //Always set to 0xFF for FS - //Set HCDMAi - chan->hcdma_reg.iso.dmaaddr_ctd = (((uint32_t)dmaaddr) & 0x1FF) << (n-3); //ctd is set to 0 -} - static inline int usbh_ll_chan_get_ctd(usb_host_chan_regs_t *chan) { return chan->hcdma_reg.non_iso.ctd; @@ -850,12 +820,12 @@ static inline int usbh_ll_chan_get_ctd(usb_host_chan_regs_t *chan) static inline void usbh_ll_chan_hctsiz_init(volatile usb_host_chan_regs_t *chan) { chan->hctsiz_reg.dopng = 0; //Don't do ping - chan->hctsiz_reg.sched_info = 0xFF; //Schedinfo is always 0xFF for fullspeed. Not used in Bulk/Ctrl channels + HAL_FORCE_MODIFY_U32_REG_FIELD(chan->hctsiz_reg, sched_info, 0xFF); //Schedinfo is always 0xFF for fullspeed. Not used in Bulk/Ctrl channels } static inline void usbh_ll_chan_set_qtd_list_len(volatile usb_host_chan_regs_t *chan, int qtd_list_len) { - chan->hctsiz_reg.ntd = qtd_list_len - 1; //Set the length of the descriptor list + HAL_FORCE_MODIFY_U32_REG_FIELD(chan->hctsiz_reg, ntd, qtd_list_len - 1); //Set the length of the descriptor list } // ---------------------------- HCDMABi Register ------------------------------- diff --git a/tools/sdk/esp32/include/idf_test/include/esp32s2/idf_performance_target.h b/tools/sdk/esp32/include/idf_test/include/esp32s2/idf_performance_target.h index f37c2a9e00f..dc8a060f54b 100644 --- a/tools/sdk/esp32/include/idf_test/include/esp32s2/idf_performance_target.h +++ b/tools/sdk/esp32/include/idf_test/include/esp32s2/idf_performance_target.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/idf_test/include/esp32s3/idf_performance_target.h b/tools/sdk/esp32/include/idf_test/include/esp32s3/idf_performance_target.h index 62f996fc658..b744cda8fa0 100644 --- a/tools/sdk/esp32/include/idf_test/include/esp32s3/idf_performance_target.h +++ b/tools/sdk/esp32/include/idf_test/include/esp32s3/idf_performance_target.h @@ -1,23 +1,15 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #define IDF_PERFORMANCE_MIN_AES_CBC_THROUGHPUT_MBSEC 43 // SHA256 hardware throughput at 240MHz, threshold set lower than worst case -#define IDF_PERFORMANCE_MIN_SHA256_THROUGHPUT_MBSEC 19.8 +#define IDF_PERFORMANCE_MIN_SHA256_THROUGHPUT_MBSEC 90 // esp_sha() time to process 32KB of input data from RAM #define IDF_PERFORMANCE_MAX_TIME_SHA1_32KB 1000 #define IDF_PERFORMANCE_MAX_TIME_SHA512_32KB 900 diff --git a/tools/sdk/esp32/include/idf_test/include/idf_performance.h b/tools/sdk/esp32/include/idf_test/include/idf_performance.h index 9d99070b953..b558feb4ca3 100644 --- a/tools/sdk/esp32/include/idf_test/include/idf_performance.h +++ b/tools/sdk/esp32/include/idf_test/include/idf_performance.h @@ -8,7 +8,7 @@ */ #ifndef IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP -#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 200 +#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 250 #endif #ifndef IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM #define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM 300 diff --git a/tools/sdk/esp32/include/lwip/port/esp32/include/lwipopts.h b/tools/sdk/esp32/include/lwip/port/esp32/include/lwipopts.h index b9cfe17aca9..47215e99dae 100644 --- a/tools/sdk/esp32/include/lwip/port/esp32/include/lwipopts.h +++ b/tools/sdk/esp32/include/lwip/port/esp32/include/lwipopts.h @@ -1,34 +1,11 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. + * SPDX-FileCopyrightText: 2001-2003 Swedish Institute of Computer Science * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Simon Goldschmidt + * SPDX-License-Identifier: BSD-3-Clause * + * SPDX-FileContributor: 2015-2021 Espressif Systems (Shanghai) CO LTD */ + #ifndef __LWIPOPTS_H__ #define __LWIPOPTS_H__ @@ -272,6 +249,11 @@ */ #define DHCP_OPTIONS_LEN CONFIG_LWIP_DHCP_OPTIONS_LEN +/** + * LWIP_DHCP_DISABLE_VENDOR_CLASS_ID==1: Do not add option 60 (Vendor Class Identifier) to DHCP packets + */ +#define ESP_DHCP_DISABLE_VENDOR_CLASS_IDENTIFIER CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID + /* ------------------------------------ ---------- AUTOIP options ---------- diff --git a/tools/sdk/esp32/include/mbedtls/port/include/mbedtls/bignum.h b/tools/sdk/esp32/include/mbedtls/port/include/mbedtls/bignum.h index a317c456060..4f84bed7407 100644 --- a/tools/sdk/esp32/include/mbedtls/port/include/mbedtls/bignum.h +++ b/tools/sdk/esp32/include/mbedtls/port/include/mbedtls/bignum.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include_next "mbedtls/bignum.h" @@ -77,4 +69,31 @@ void esp_mpi_release_hardware(void); */ int esp_mpi_mul_mpi_mod(mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M); +#if CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI + +/** + * @brief Perform a sliding-window exponentiation: X = A^E mod N + * + * @param X The destination MPI. This must point to an initialized MPI. + * @param A The base of the exponentiation. + * This must point to an initialized MPI. + * @param E The exponent MPI. This must point to an initialized MPI. + * @param N The base for the modular reduction. This must point to an + * initialized MPI. + * @param _RR A helper MPI depending solely on \p N which can be used to + * speed-up multiple modular exponentiations for the same value + * of \p N. This may be \c NULL. If it is not \c NULL, it must + * point to an initialized MPI. + * + * @return \c 0 if successful. + * @return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. + * @return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \c N is negative or + * even, or if \c E is negative. + * @return Another negative error code on different kinds of failures. + * + */ +int mbedtls_mpi_exp_mod_soft(mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *E, const mbedtls_mpi *N, mbedtls_mpi *_RR); + +#endif // CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI + #endif // CONFIG_MBEDTLS_HARDWARE_MPI diff --git a/tools/sdk/esp32/include/mbedtls/port/include/mbedtls/esp_config.h b/tools/sdk/esp32/include/mbedtls/port/include/mbedtls/esp_config.h index f36ebf9bc75..9c63118eb57 100644 --- a/tools/sdk/esp32/include/mbedtls/port/include/mbedtls/esp_config.h +++ b/tools/sdk/esp32/include/mbedtls/port/include/mbedtls/esp_config.h @@ -153,15 +153,22 @@ #undef MBEDTLS_MD5_ALT #endif -/* The following MPI (bignum) functions have ESP32 hardware support. - For exponential mod, both software and hardware implementation - will be compiled. If CONFIG_MBEDTLS_HARDWARE_MPI is enabled, mod APIs - will be wrapped to use hardware implementation. -*/ -#undef MBEDTLS_MPI_EXP_MOD_ALT +/* The following MPI (bignum) functions have hardware support. + * Uncommenting these macros will use the hardware-accelerated + * implementations. + */ #ifdef CONFIG_MBEDTLS_HARDWARE_MPI +#ifdef CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI + /* Prefer hardware and fallback to software */ + #define MBEDTLS_MPI_EXP_MOD_ALT_FALLBACK +#else + /* Hardware only mode */ + #define MBEDTLS_MPI_EXP_MOD_ALT +#endif #define MBEDTLS_MPI_MUL_MPI_ALT #else +#undef MBEDTLS_MPI_EXP_MOD_ALT_FALLBACK +#undef MBEDTLS_MPI_EXP_MOD_ALT #undef MBEDTLS_MPI_MUL_MPI_ALT #endif diff --git a/tools/sdk/esp32/include/sdmmc/include/sdmmc_cmd.h b/tools/sdk/esp32/include/sdmmc/include/sdmmc_cmd.h index 6e2f98d90d6..e0e7162391b 100644 --- a/tools/sdk/esp32/include/sdmmc/include/sdmmc_cmd.h +++ b/tools/sdk/esp32/include/sdmmc/include/sdmmc_cmd.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -45,6 +37,17 @@ esp_err_t sdmmc_card_init(const sdmmc_host_t* host, */ void sdmmc_card_print_info(FILE* stream, const sdmmc_card_t* card); +/** + * Get status of SD/MMC card + * + * @param card pointer to card information structure previously initialized + * using sdmmc_card_init + * @return + * - ESP_OK on success + * - One of the error codes from SDMMC host controller + */ +esp_err_t sdmmc_get_status(sdmmc_card_t* card); + /** * Write given number of sectors to SD/MMC card * diff --git a/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h b/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h index 88b6f1c8ee2..c31a12d0fe7 100644 --- a/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h +++ b/tools/sdk/esp32/include/soc/esp32/include/soc/soc_caps.h @@ -56,6 +56,7 @@ #define SOC_MCPWM_SUPPORTED 1 #define SOC_SDMMC_HOST_SUPPORTED 1 #define SOC_BT_SUPPORTED 1 +#define SOC_CLASSIC_BT_SUPPORTED 1 #define SOC_PCNT_SUPPORTED 1 #define SOC_SDIO_SLAVE_SUPPORTED 1 #define SOC_TWAI_SUPPORTED 1 diff --git a/tools/sdk/esp32/include/vfs/include/esp_vfs.h b/tools/sdk/esp32/include/vfs/include/esp_vfs.h index 7ba63645301..0498a3aa59b 100644 --- a/tools/sdk/esp32/include/vfs/include/esp_vfs.h +++ b/tools/sdk/esp32/include/vfs/include/esp_vfs.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __ESP_VFS_H__ #define __ESP_VFS_H__ @@ -254,7 +246,6 @@ typedef struct #endif // CONFIG_VFS_SUPPORT_SELECT } esp_vfs_t; - /** * Register a virtual filesystem for given path prefix. * @@ -411,7 +402,8 @@ int esp_vfs_utime(const char *path, const struct utimbuf *times); * @param timeout If not NULL, then points to timeval structure which * specifies the time period after which the functions should * time-out and return. If it is NULL, then the function will - * not time-out. + * not time-out. Note that the timeout period is rounded up to + * the system tick and incremented by one. * * @return The number of descriptors set in the descriptor sets, or -1 * when an error (specified by errno) have occurred. diff --git a/tools/sdk/esp32/include/vfs/include/esp_vfs_cdcacm.h b/tools/sdk/esp32/include/vfs/include/esp_vfs_cdcacm.h index b8dd03d92aa..416efb35a4e 100644 --- a/tools/sdk/esp32/include/vfs/include/esp_vfs_cdcacm.h +++ b/tools/sdk/esp32/include/vfs/include/esp_vfs_cdcacm.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/vfs/include/esp_vfs_console.h b/tools/sdk/esp32/include/vfs/include/esp_vfs_console.h new file mode 100644 index 00000000000..bc5ce6733dd --- /dev/null +++ b/tools/sdk/esp32/include/vfs/include/esp_vfs_console.h @@ -0,0 +1,24 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief add uart/usb_serial_jtag/usb_otg_acmcdc virtual filesystem driver + * + * This function is called from startup code to enable serial output + */ +esp_err_t esp_vfs_console_register(void); + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32/include/vfs/include/esp_vfs_dev.h b/tools/sdk/esp32/include/vfs/include/esp_vfs_dev.h index dc33fe746dc..91e9374972e 100644 --- a/tools/sdk/esp32/include/vfs/include/esp_vfs_dev.h +++ b/tools/sdk/esp32/include/vfs/include/esp_vfs_dev.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/include/vfs/include/esp_vfs_usb_serial_jtag.h b/tools/sdk/esp32/include/vfs/include/esp_vfs_usb_serial_jtag.h index 54ff1f4e444..c53a671be89 100644 --- a/tools/sdk/esp32/include/vfs/include/esp_vfs_usb_serial_jtag.h +++ b/tools/sdk/esp32/include/vfs/include/esp_vfs_usb_serial_jtag.h @@ -1,16 +1,8 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32/ld/libbtdm_app.a b/tools/sdk/esp32/ld/libbtdm_app.a index 275227ef835..beeef6cd169 100644 Binary files a/tools/sdk/esp32/ld/libbtdm_app.a and b/tools/sdk/esp32/ld/libbtdm_app.a differ diff --git a/tools/sdk/esp32/ld/libcat_face_detect.a b/tools/sdk/esp32/ld/libcat_face_detect.a index 04377a9d8d8..c7a9cb5440d 100644 Binary files a/tools/sdk/esp32/ld/libcat_face_detect.a and b/tools/sdk/esp32/ld/libcat_face_detect.a differ diff --git a/tools/sdk/esp32/ld/libcolor_detect.a b/tools/sdk/esp32/ld/libcolor_detect.a index e03e142ec20..29267ed392a 100644 Binary files a/tools/sdk/esp32/ld/libcolor_detect.a and b/tools/sdk/esp32/ld/libcolor_detect.a differ diff --git a/tools/sdk/esp32/ld/libdl.a b/tools/sdk/esp32/ld/libdl.a index 87f5037101b..8b5db786f2d 100644 Binary files a/tools/sdk/esp32/ld/libdl.a and b/tools/sdk/esp32/ld/libdl.a differ diff --git a/tools/sdk/esp32/ld/libhuman_face_detect.a b/tools/sdk/esp32/ld/libhuman_face_detect.a index a471b47c0bf..cd849d2c661 100644 Binary files a/tools/sdk/esp32/ld/libhuman_face_detect.a and b/tools/sdk/esp32/ld/libhuman_face_detect.a differ diff --git a/tools/sdk/esp32/ld/libmfn.a b/tools/sdk/esp32/ld/libmfn.a index 5cffd5cb576..fcc4727cc1b 100644 Binary files a/tools/sdk/esp32/ld/libmfn.a and b/tools/sdk/esp32/ld/libmfn.a differ diff --git a/tools/sdk/esp32/ld/sections.ld b/tools/sdk/esp32/ld/sections.ld index d8f0811f95e..40feea9f011 100644 --- a/tools/sdk/esp32/ld/sections.ld +++ b/tools/sdk/esp32/ld/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32/sections.ld.in */ +/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -322,8 +322,8 @@ SECTIONS *libesp_system.a:esp_system.*(.literal.esp_system_abort .text.esp_system_abort) *libesp_system.a:ubsan.*(.literal .literal.* .text .text.*) *libfreertos.a:(EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .literal EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .literal.* EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .text EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .text.*) - *libfreertos.a:port.*(.literal.pxPortInitialiseStack .literal.unlikely.vPortEndScheduler .literal.vApplicationStackOverflowHook .literal.vPortAssertIfInISR .literal.vPortEnterCritical .literal.vPortExitCritical .literal.vPortReleaseTaskMPUSettings .literal.vPortSetStackWatchpoint .literal.vPortYieldOtherCore .literal.xPortInIsrContext .literal.xPortStartScheduler .text .text.pxPortInitialiseStack .text.unlikely.vPortEndScheduler .text.vApplicationStackOverflowHook .text.vPortAssertIfInISR .text.vPortEnterCritical .text.vPortExitCritical .text.vPortReleaseTaskMPUSettings .text.vPortSetStackWatchpoint .text.vPortStoreTaskMPUSettings .text.vPortYieldOtherCore .text.xPortGetTickRateHz .text.xPortInIsrContext .text.xPortStartScheduler) - *libfreertos.a:port_common.*(.literal.esp_startup_start_app_common .literal.xPortCheckValidTCBMem .literal.xPortcheckValidStackMem .text .text.esp_startup_start_app_common .text.xPortCheckValidTCBMem .text.xPortcheckValidStackMem) + *libfreertos.a:port.*(.literal.pxPortInitialiseStack .literal.unlikely.vPortEndScheduler .literal.vApplicationStackOverflowHook .literal.vPortAssertIfInISR .literal.vPortExitCritical .literal.vPortExitCriticalCompliance .literal.vPortReleaseTaskMPUSettings .literal.vPortSetStackWatchpoint .literal.vPortYieldOtherCore .literal.xPortEnterCriticalTimeout .literal.xPortEnterCriticalTimeoutCompliance .literal.xPortInIsrContext .literal.xPortStartScheduler .text .text.pxPortInitialiseStack .text.unlikely.vPortEndScheduler .text.vApplicationStackOverflowHook .text.vPortAssertIfInISR .text.vPortExitCritical .text.vPortExitCriticalCompliance .text.vPortReleaseTaskMPUSettings .text.vPortSetStackWatchpoint .text.vPortStoreTaskMPUSettings .text.vPortYieldOtherCore .text.xPortEnterCriticalTimeout .text.xPortEnterCriticalTimeoutCompliance .text.xPortGetTickRateHz .text.xPortInIsrContext .text.xPortStartScheduler) + *libfreertos.a:port_common.*(.literal.esp_startup_start_app_common .literal.vApplicationGetIdleTaskMemory .literal.vApplicationGetTimerTaskMemory .literal.xPortCheckValidTCBMem .literal.xPortcheckValidStackMem .text .text.esp_startup_start_app_common .text.vApplicationGetIdleTaskMemory .text.vApplicationGetTimerTaskMemory .text.xPortCheckValidTCBMem .text.xPortcheckValidStackMem) *libgcc.a:lib2funcs.*(.literal .literal.* .text .text.*) *libgcov.a:(.literal .literal.* .text .text.*) *libhal.a:cpu_hal.*(.literal .literal.* .text .text.*) diff --git a/tools/sdk/esp32/lib/libapp_trace.a b/tools/sdk/esp32/lib/libapp_trace.a index b25a3c4ba56..148e16886d3 100644 Binary files a/tools/sdk/esp32/lib/libapp_trace.a and b/tools/sdk/esp32/lib/libapp_trace.a differ diff --git a/tools/sdk/esp32/lib/libapp_update.a b/tools/sdk/esp32/lib/libapp_update.a index 13839e39463..34b6f44ca46 100644 Binary files a/tools/sdk/esp32/lib/libapp_update.a and b/tools/sdk/esp32/lib/libapp_update.a differ diff --git a/tools/sdk/esp32/lib/libasio.a b/tools/sdk/esp32/lib/libasio.a index 305eacb395f..62911b4fa6e 100644 Binary files a/tools/sdk/esp32/lib/libasio.a and b/tools/sdk/esp32/lib/libasio.a differ diff --git a/tools/sdk/esp32/lib/libbootloader_support.a b/tools/sdk/esp32/lib/libbootloader_support.a index 61abed8d7b6..c94a3429142 100644 Binary files a/tools/sdk/esp32/lib/libbootloader_support.a and b/tools/sdk/esp32/lib/libbootloader_support.a differ diff --git a/tools/sdk/esp32/lib/libbt.a b/tools/sdk/esp32/lib/libbt.a index e740b5ba4c6..7f819f94986 100644 Binary files a/tools/sdk/esp32/lib/libbt.a and b/tools/sdk/esp32/lib/libbt.a differ diff --git a/tools/sdk/esp32/lib/libbutton.a b/tools/sdk/esp32/lib/libbutton.a index 572ce3829b3..9c64e6bcda2 100644 Binary files a/tools/sdk/esp32/lib/libbutton.a and b/tools/sdk/esp32/lib/libbutton.a differ diff --git a/tools/sdk/esp32/lib/libcbor.a b/tools/sdk/esp32/lib/libcbor.a index f87209eaa16..f6ab7028412 100644 Binary files a/tools/sdk/esp32/lib/libcbor.a and b/tools/sdk/esp32/lib/libcbor.a differ diff --git a/tools/sdk/esp32/lib/libcmock.a b/tools/sdk/esp32/lib/libcmock.a index d6340e6abab..9056158fe87 100644 Binary files a/tools/sdk/esp32/lib/libcmock.a and b/tools/sdk/esp32/lib/libcmock.a differ diff --git a/tools/sdk/esp32/lib/libcoap.a b/tools/sdk/esp32/lib/libcoap.a index c1d56122b0f..577c42f675b 100644 Binary files a/tools/sdk/esp32/lib/libcoap.a and b/tools/sdk/esp32/lib/libcoap.a differ diff --git a/tools/sdk/esp32/lib/libcoexist.a b/tools/sdk/esp32/lib/libcoexist.a index c646358914a..e264552b613 100644 Binary files a/tools/sdk/esp32/lib/libcoexist.a and b/tools/sdk/esp32/lib/libcoexist.a differ diff --git a/tools/sdk/esp32/lib/libconsole.a b/tools/sdk/esp32/lib/libconsole.a index 8af34b56b39..371e864a255 100644 Binary files a/tools/sdk/esp32/lib/libconsole.a and b/tools/sdk/esp32/lib/libconsole.a differ diff --git a/tools/sdk/esp32/lib/libcore.a b/tools/sdk/esp32/lib/libcore.a index 34fa3951f34..ff041c7699d 100644 Binary files a/tools/sdk/esp32/lib/libcore.a and b/tools/sdk/esp32/lib/libcore.a differ diff --git a/tools/sdk/esp32/lib/libcxx.a b/tools/sdk/esp32/lib/libcxx.a index 3ba76ae486d..cea577ffba2 100644 Binary files a/tools/sdk/esp32/lib/libcxx.a and b/tools/sdk/esp32/lib/libcxx.a differ diff --git a/tools/sdk/esp32/lib/libdriver.a b/tools/sdk/esp32/lib/libdriver.a index a5c8f4904ac..e042cb61eb3 100644 Binary files a/tools/sdk/esp32/lib/libdriver.a and b/tools/sdk/esp32/lib/libdriver.a differ diff --git a/tools/sdk/esp32/lib/libefuse.a b/tools/sdk/esp32/lib/libefuse.a index 080a35eb140..cc38c1b835d 100644 Binary files a/tools/sdk/esp32/lib/libefuse.a and b/tools/sdk/esp32/lib/libefuse.a differ diff --git a/tools/sdk/esp32/lib/libesp-dsp.a b/tools/sdk/esp32/lib/libesp-dsp.a index a818449f09c..cb57f58e990 100644 Binary files a/tools/sdk/esp32/lib/libesp-dsp.a and b/tools/sdk/esp32/lib/libesp-dsp.a differ diff --git a/tools/sdk/esp32/lib/libesp-tls.a b/tools/sdk/esp32/lib/libesp-tls.a index f194a219d84..47011e74b98 100644 Binary files a/tools/sdk/esp32/lib/libesp-tls.a and b/tools/sdk/esp32/lib/libesp-tls.a differ diff --git a/tools/sdk/esp32/lib/libesp32-camera.a b/tools/sdk/esp32/lib/libesp32-camera.a index 18b9bc684c3..186ff1de743 100644 Binary files a/tools/sdk/esp32/lib/libesp32-camera.a and b/tools/sdk/esp32/lib/libesp32-camera.a differ diff --git a/tools/sdk/esp32/lib/libesp_adc_cal.a b/tools/sdk/esp32/lib/libesp_adc_cal.a index a4d20dfa7ab..216029001ed 100644 Binary files a/tools/sdk/esp32/lib/libesp_adc_cal.a and b/tools/sdk/esp32/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/esp32/lib/libesp_common.a b/tools/sdk/esp32/lib/libesp_common.a index febbef8f3a0..bf9014aa2ff 100644 Binary files a/tools/sdk/esp32/lib/libesp_common.a and b/tools/sdk/esp32/lib/libesp_common.a differ diff --git a/tools/sdk/esp32/lib/libesp_eth.a b/tools/sdk/esp32/lib/libesp_eth.a index 85492534302..73e5ab542d8 100644 Binary files a/tools/sdk/esp32/lib/libesp_eth.a and b/tools/sdk/esp32/lib/libesp_eth.a differ diff --git a/tools/sdk/esp32/lib/libesp_event.a b/tools/sdk/esp32/lib/libesp_event.a index 26587a90ba9..6887ef71156 100644 Binary files a/tools/sdk/esp32/lib/libesp_event.a and b/tools/sdk/esp32/lib/libesp_event.a differ diff --git a/tools/sdk/esp32/lib/libesp_gdbstub.a b/tools/sdk/esp32/lib/libesp_gdbstub.a index 46c3a9af637..fc5f2e85a8b 100644 Binary files a/tools/sdk/esp32/lib/libesp_gdbstub.a and b/tools/sdk/esp32/lib/libesp_gdbstub.a differ diff --git a/tools/sdk/esp32/lib/libesp_hid.a b/tools/sdk/esp32/lib/libesp_hid.a index e84f0f8cc2a..43a36ad8280 100644 Binary files a/tools/sdk/esp32/lib/libesp_hid.a and b/tools/sdk/esp32/lib/libesp_hid.a differ diff --git a/tools/sdk/esp32/lib/libesp_http_client.a b/tools/sdk/esp32/lib/libesp_http_client.a index bbc080d75f0..85d98c486d1 100644 Binary files a/tools/sdk/esp32/lib/libesp_http_client.a and b/tools/sdk/esp32/lib/libesp_http_client.a differ diff --git a/tools/sdk/esp32/lib/libesp_http_server.a b/tools/sdk/esp32/lib/libesp_http_server.a index 9a8a60717ca..e004e4f4ad2 100644 Binary files a/tools/sdk/esp32/lib/libesp_http_server.a and b/tools/sdk/esp32/lib/libesp_http_server.a differ diff --git a/tools/sdk/esp32/lib/libesp_https_ota.a b/tools/sdk/esp32/lib/libesp_https_ota.a index 9a94a73233a..91c7a1edcd8 100644 Binary files a/tools/sdk/esp32/lib/libesp_https_ota.a and b/tools/sdk/esp32/lib/libesp_https_ota.a differ diff --git a/tools/sdk/esp32/lib/libesp_hw_support.a b/tools/sdk/esp32/lib/libesp_hw_support.a index 58b90acfe55..199a74d0543 100644 Binary files a/tools/sdk/esp32/lib/libesp_hw_support.a and b/tools/sdk/esp32/lib/libesp_hw_support.a differ diff --git a/tools/sdk/esp32/lib/libesp_ipc.a b/tools/sdk/esp32/lib/libesp_ipc.a index 73fdf4cd88e..ced6b39cf53 100644 Binary files a/tools/sdk/esp32/lib/libesp_ipc.a and b/tools/sdk/esp32/lib/libesp_ipc.a differ diff --git a/tools/sdk/esp32/lib/libesp_lcd.a b/tools/sdk/esp32/lib/libesp_lcd.a index bd63dadbf16..5e7ade52bf6 100644 Binary files a/tools/sdk/esp32/lib/libesp_lcd.a and b/tools/sdk/esp32/lib/libesp_lcd.a differ diff --git a/tools/sdk/esp32/lib/libesp_littlefs.a b/tools/sdk/esp32/lib/libesp_littlefs.a index a716a327eaf..b28436b2548 100644 Binary files a/tools/sdk/esp32/lib/libesp_littlefs.a and b/tools/sdk/esp32/lib/libesp_littlefs.a differ diff --git a/tools/sdk/esp32/lib/libesp_local_ctrl.a b/tools/sdk/esp32/lib/libesp_local_ctrl.a index 03e01b98a0e..81eddfa489a 100644 Binary files a/tools/sdk/esp32/lib/libesp_local_ctrl.a and b/tools/sdk/esp32/lib/libesp_local_ctrl.a differ diff --git a/tools/sdk/esp32/lib/libesp_netif.a b/tools/sdk/esp32/lib/libesp_netif.a index a776991ed2c..22dda939c2a 100644 Binary files a/tools/sdk/esp32/lib/libesp_netif.a and b/tools/sdk/esp32/lib/libesp_netif.a differ diff --git a/tools/sdk/esp32/lib/libesp_phy.a b/tools/sdk/esp32/lib/libesp_phy.a index 8017659fa85..438d0c001d2 100644 Binary files a/tools/sdk/esp32/lib/libesp_phy.a and b/tools/sdk/esp32/lib/libesp_phy.a differ diff --git a/tools/sdk/esp32/lib/libesp_pm.a b/tools/sdk/esp32/lib/libesp_pm.a index ce83010a368..411672cd44b 100644 Binary files a/tools/sdk/esp32/lib/libesp_pm.a and b/tools/sdk/esp32/lib/libesp_pm.a differ diff --git a/tools/sdk/esp32/lib/libesp_rainmaker.a b/tools/sdk/esp32/lib/libesp_rainmaker.a index f52d646c6af..73f1c801fe7 100644 Binary files a/tools/sdk/esp32/lib/libesp_rainmaker.a and b/tools/sdk/esp32/lib/libesp_rainmaker.a differ diff --git a/tools/sdk/esp32/lib/libesp_ringbuf.a b/tools/sdk/esp32/lib/libesp_ringbuf.a index 77d39ee8321..7d52bcc2570 100644 Binary files a/tools/sdk/esp32/lib/libesp_ringbuf.a and b/tools/sdk/esp32/lib/libesp_ringbuf.a differ diff --git a/tools/sdk/esp32/lib/libesp_rom.a b/tools/sdk/esp32/lib/libesp_rom.a index b943df28c92..a8ed7b9fbe5 100644 Binary files a/tools/sdk/esp32/lib/libesp_rom.a and b/tools/sdk/esp32/lib/libesp_rom.a differ diff --git a/tools/sdk/esp32/lib/libesp_schedule.a b/tools/sdk/esp32/lib/libesp_schedule.a index a47fbb9d199..c198386bcc0 100644 Binary files a/tools/sdk/esp32/lib/libesp_schedule.a and b/tools/sdk/esp32/lib/libesp_schedule.a differ diff --git a/tools/sdk/esp32/lib/libesp_serial_slave_link.a b/tools/sdk/esp32/lib/libesp_serial_slave_link.a index 1cfb61edd6f..082a41ac404 100644 Binary files a/tools/sdk/esp32/lib/libesp_serial_slave_link.a and b/tools/sdk/esp32/lib/libesp_serial_slave_link.a differ diff --git a/tools/sdk/esp32/lib/libesp_system.a b/tools/sdk/esp32/lib/libesp_system.a index 12ce6be7b51..c002693990d 100644 Binary files a/tools/sdk/esp32/lib/libesp_system.a and b/tools/sdk/esp32/lib/libesp_system.a differ diff --git a/tools/sdk/esp32/lib/libesp_timer.a b/tools/sdk/esp32/lib/libesp_timer.a index b074dad474c..8182f0920b6 100644 Binary files a/tools/sdk/esp32/lib/libesp_timer.a and b/tools/sdk/esp32/lib/libesp_timer.a differ diff --git a/tools/sdk/esp32/lib/libesp_websocket_client.a b/tools/sdk/esp32/lib/libesp_websocket_client.a index bf73e56c030..7b9c9295e86 100644 Binary files a/tools/sdk/esp32/lib/libesp_websocket_client.a and b/tools/sdk/esp32/lib/libesp_websocket_client.a differ diff --git a/tools/sdk/esp32/lib/libesp_wifi.a b/tools/sdk/esp32/lib/libesp_wifi.a index 0c239700e27..d1175bbaa61 100644 Binary files a/tools/sdk/esp32/lib/libesp_wifi.a and b/tools/sdk/esp32/lib/libesp_wifi.a differ diff --git a/tools/sdk/esp32/lib/libespcoredump.a b/tools/sdk/esp32/lib/libespcoredump.a index 0b8bb5b7fc5..8e6bff5b97e 100644 Binary files a/tools/sdk/esp32/lib/libespcoredump.a and b/tools/sdk/esp32/lib/libespcoredump.a differ diff --git a/tools/sdk/esp32/lib/libespnow.a b/tools/sdk/esp32/lib/libespnow.a index 23b681bbcb2..6b059b57334 100644 Binary files a/tools/sdk/esp32/lib/libespnow.a and b/tools/sdk/esp32/lib/libespnow.a differ diff --git a/tools/sdk/esp32/lib/libexpat.a b/tools/sdk/esp32/lib/libexpat.a index fb6b9fd8d2f..9ab783bcec8 100644 Binary files a/tools/sdk/esp32/lib/libexpat.a and b/tools/sdk/esp32/lib/libexpat.a differ diff --git a/tools/sdk/esp32/lib/libfatfs.a b/tools/sdk/esp32/lib/libfatfs.a index f1c5a001a58..a3d4d23e72c 100644 Binary files a/tools/sdk/esp32/lib/libfatfs.a and b/tools/sdk/esp32/lib/libfatfs.a differ diff --git a/tools/sdk/esp32/lib/libfb_gfx.a b/tools/sdk/esp32/lib/libfb_gfx.a index 7d2491aca7b..b7a6dcd6d62 100644 Binary files a/tools/sdk/esp32/lib/libfb_gfx.a and b/tools/sdk/esp32/lib/libfb_gfx.a differ diff --git a/tools/sdk/esp32/lib/libfreemodbus.a b/tools/sdk/esp32/lib/libfreemodbus.a index ed7a3b399c3..6179afed0b4 100644 Binary files a/tools/sdk/esp32/lib/libfreemodbus.a and b/tools/sdk/esp32/lib/libfreemodbus.a differ diff --git a/tools/sdk/esp32/lib/libfreertos.a b/tools/sdk/esp32/lib/libfreertos.a index e1a8d92eb9e..ab471d6d58d 100644 Binary files a/tools/sdk/esp32/lib/libfreertos.a and b/tools/sdk/esp32/lib/libfreertos.a differ diff --git a/tools/sdk/esp32/lib/libhal.a b/tools/sdk/esp32/lib/libhal.a index 388f9d91124..29c32dc7249 100644 Binary files a/tools/sdk/esp32/lib/libhal.a and b/tools/sdk/esp32/lib/libhal.a differ diff --git a/tools/sdk/esp32/lib/libheap.a b/tools/sdk/esp32/lib/libheap.a index aff7699f9ea..cfe17cb2c24 100644 Binary files a/tools/sdk/esp32/lib/libheap.a and b/tools/sdk/esp32/lib/libheap.a differ diff --git a/tools/sdk/esp32/lib/libjsmn.a b/tools/sdk/esp32/lib/libjsmn.a index f5dc3b0dc10..32b560d553c 100644 Binary files a/tools/sdk/esp32/lib/libjsmn.a and b/tools/sdk/esp32/lib/libjsmn.a differ diff --git a/tools/sdk/esp32/lib/libjson.a b/tools/sdk/esp32/lib/libjson.a index 39c452364ec..fbc79a6be18 100644 Binary files a/tools/sdk/esp32/lib/libjson.a and b/tools/sdk/esp32/lib/libjson.a differ diff --git a/tools/sdk/esp32/lib/libjson_generator.a b/tools/sdk/esp32/lib/libjson_generator.a index cb98d629ed1..59ff0d4d1b9 100644 Binary files a/tools/sdk/esp32/lib/libjson_generator.a and b/tools/sdk/esp32/lib/libjson_generator.a differ diff --git a/tools/sdk/esp32/lib/libjson_parser.a b/tools/sdk/esp32/lib/libjson_parser.a index 4ea111815db..c8f5b54fa33 100644 Binary files a/tools/sdk/esp32/lib/libjson_parser.a and b/tools/sdk/esp32/lib/libjson_parser.a differ diff --git a/tools/sdk/esp32/lib/liblibsodium.a b/tools/sdk/esp32/lib/liblibsodium.a index 78229f370d2..a34fa2f3562 100644 Binary files a/tools/sdk/esp32/lib/liblibsodium.a and b/tools/sdk/esp32/lib/liblibsodium.a differ diff --git a/tools/sdk/esp32/lib/liblog.a b/tools/sdk/esp32/lib/liblog.a index 4b1103a20b8..88fdc988177 100644 Binary files a/tools/sdk/esp32/lib/liblog.a and b/tools/sdk/esp32/lib/liblog.a differ diff --git a/tools/sdk/esp32/lib/liblwip.a b/tools/sdk/esp32/lib/liblwip.a index da5cf93e8f4..75d915bb0f1 100644 Binary files a/tools/sdk/esp32/lib/liblwip.a and b/tools/sdk/esp32/lib/liblwip.a differ diff --git a/tools/sdk/esp32/lib/libmbedcrypto.a b/tools/sdk/esp32/lib/libmbedcrypto.a index 88076b80445..eb815d40b37 100644 Binary files a/tools/sdk/esp32/lib/libmbedcrypto.a and b/tools/sdk/esp32/lib/libmbedcrypto.a differ diff --git a/tools/sdk/esp32/lib/libmbedtls.a b/tools/sdk/esp32/lib/libmbedtls.a index 0502aa9060e..74aa87048e4 100644 Binary files a/tools/sdk/esp32/lib/libmbedtls.a and b/tools/sdk/esp32/lib/libmbedtls.a differ diff --git a/tools/sdk/esp32/lib/libmbedx509.a b/tools/sdk/esp32/lib/libmbedx509.a index 7b86a7874cf..5fc1eb32e08 100644 Binary files a/tools/sdk/esp32/lib/libmbedx509.a and b/tools/sdk/esp32/lib/libmbedx509.a differ diff --git a/tools/sdk/esp32/lib/libmdns.a b/tools/sdk/esp32/lib/libmdns.a index 2c0a4c2680b..3da44bdf276 100644 Binary files a/tools/sdk/esp32/lib/libmdns.a and b/tools/sdk/esp32/lib/libmdns.a differ diff --git a/tools/sdk/esp32/lib/libmesh.a b/tools/sdk/esp32/lib/libmesh.a index 2996463b120..6316c346889 100644 Binary files a/tools/sdk/esp32/lib/libmesh.a and b/tools/sdk/esp32/lib/libmesh.a differ diff --git a/tools/sdk/esp32/lib/libmqtt.a b/tools/sdk/esp32/lib/libmqtt.a index a69390962c6..003a9f65a1f 100644 Binary files a/tools/sdk/esp32/lib/libmqtt.a and b/tools/sdk/esp32/lib/libmqtt.a differ diff --git a/tools/sdk/esp32/lib/libnet80211.a b/tools/sdk/esp32/lib/libnet80211.a index 35fab3d86d7..a3720ee9f58 100644 Binary files a/tools/sdk/esp32/lib/libnet80211.a and b/tools/sdk/esp32/lib/libnet80211.a differ diff --git a/tools/sdk/esp32/lib/libnewlib.a b/tools/sdk/esp32/lib/libnewlib.a index 99d1f25bf6b..9b8f2a12373 100644 Binary files a/tools/sdk/esp32/lib/libnewlib.a and b/tools/sdk/esp32/lib/libnewlib.a differ diff --git a/tools/sdk/esp32/lib/libnghttp.a b/tools/sdk/esp32/lib/libnghttp.a index 1cd0cfc7d87..fd7dc5de016 100644 Binary files a/tools/sdk/esp32/lib/libnghttp.a and b/tools/sdk/esp32/lib/libnghttp.a differ diff --git a/tools/sdk/esp32/lib/libnvs_flash.a b/tools/sdk/esp32/lib/libnvs_flash.a index 5a32a6df1eb..e22d19d9093 100644 Binary files a/tools/sdk/esp32/lib/libnvs_flash.a and b/tools/sdk/esp32/lib/libnvs_flash.a differ diff --git a/tools/sdk/esp32/lib/libopenssl.a b/tools/sdk/esp32/lib/libopenssl.a index 03e1e860e28..33c365e6c4c 100644 Binary files a/tools/sdk/esp32/lib/libopenssl.a and b/tools/sdk/esp32/lib/libopenssl.a differ diff --git a/tools/sdk/esp32/lib/libperfmon.a b/tools/sdk/esp32/lib/libperfmon.a index d648a39ca6b..0eefff1489a 100644 Binary files a/tools/sdk/esp32/lib/libperfmon.a and b/tools/sdk/esp32/lib/libperfmon.a differ diff --git a/tools/sdk/esp32/lib/libpp.a b/tools/sdk/esp32/lib/libpp.a index ebb3f20319d..56c3c8a99a9 100644 Binary files a/tools/sdk/esp32/lib/libpp.a and b/tools/sdk/esp32/lib/libpp.a differ diff --git a/tools/sdk/esp32/lib/libprotobuf-c.a b/tools/sdk/esp32/lib/libprotobuf-c.a index a24f8939cb4..bbee5a1afd0 100644 Binary files a/tools/sdk/esp32/lib/libprotobuf-c.a and b/tools/sdk/esp32/lib/libprotobuf-c.a differ diff --git a/tools/sdk/esp32/lib/libprotocomm.a b/tools/sdk/esp32/lib/libprotocomm.a index 46cea7d0640..58c3bc21e83 100644 Binary files a/tools/sdk/esp32/lib/libprotocomm.a and b/tools/sdk/esp32/lib/libprotocomm.a differ diff --git a/tools/sdk/esp32/lib/libpthread.a b/tools/sdk/esp32/lib/libpthread.a index 9d971fb80c5..6b0507564d5 100644 Binary files a/tools/sdk/esp32/lib/libpthread.a and b/tools/sdk/esp32/lib/libpthread.a differ diff --git a/tools/sdk/esp32/lib/libqrcode.a b/tools/sdk/esp32/lib/libqrcode.a index d2afba153aa..b0277b77fc7 100644 Binary files a/tools/sdk/esp32/lib/libqrcode.a and b/tools/sdk/esp32/lib/libqrcode.a differ diff --git a/tools/sdk/esp32/lib/libsdmmc.a b/tools/sdk/esp32/lib/libsdmmc.a index 63074f28a70..d15d743f3fe 100644 Binary files a/tools/sdk/esp32/lib/libsdmmc.a and b/tools/sdk/esp32/lib/libsdmmc.a differ diff --git a/tools/sdk/esp32/lib/libsmartconfig.a b/tools/sdk/esp32/lib/libsmartconfig.a index 20cd2c1b880..3fa3d0b2119 100644 Binary files a/tools/sdk/esp32/lib/libsmartconfig.a and b/tools/sdk/esp32/lib/libsmartconfig.a differ diff --git a/tools/sdk/esp32/lib/libsoc.a b/tools/sdk/esp32/lib/libsoc.a index cfb71ed3c63..05ed5a5c4dc 100644 Binary files a/tools/sdk/esp32/lib/libsoc.a and b/tools/sdk/esp32/lib/libsoc.a differ diff --git a/tools/sdk/esp32/lib/libspi_flash.a b/tools/sdk/esp32/lib/libspi_flash.a index d17fa485bde..26be7244e85 100644 Binary files a/tools/sdk/esp32/lib/libspi_flash.a and b/tools/sdk/esp32/lib/libspi_flash.a differ diff --git a/tools/sdk/esp32/lib/libspiffs.a b/tools/sdk/esp32/lib/libspiffs.a index 5c4c3aba888..cdcfe9ef7d7 100644 Binary files a/tools/sdk/esp32/lib/libspiffs.a and b/tools/sdk/esp32/lib/libspiffs.a differ diff --git a/tools/sdk/esp32/lib/libtcp_transport.a b/tools/sdk/esp32/lib/libtcp_transport.a index 089e2bf28d1..c194e2ab0c8 100644 Binary files a/tools/sdk/esp32/lib/libtcp_transport.a and b/tools/sdk/esp32/lib/libtcp_transport.a differ diff --git a/tools/sdk/esp32/lib/libtcpip_adapter.a b/tools/sdk/esp32/lib/libtcpip_adapter.a index 03aacaa6e66..4dc14d4b148 100644 Binary files a/tools/sdk/esp32/lib/libtcpip_adapter.a and b/tools/sdk/esp32/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/esp32/lib/libulp.a b/tools/sdk/esp32/lib/libulp.a index 596fbd23f2b..420dfd9d1de 100644 Binary files a/tools/sdk/esp32/lib/libulp.a and b/tools/sdk/esp32/lib/libulp.a differ diff --git a/tools/sdk/esp32/lib/libunity.a b/tools/sdk/esp32/lib/libunity.a index 6c88762b9b0..74214ab7b1b 100644 Binary files a/tools/sdk/esp32/lib/libunity.a and b/tools/sdk/esp32/lib/libunity.a differ diff --git a/tools/sdk/esp32/lib/libvfs.a b/tools/sdk/esp32/lib/libvfs.a index 72263bfea40..b45487e710d 100644 Binary files a/tools/sdk/esp32/lib/libvfs.a and b/tools/sdk/esp32/lib/libvfs.a differ diff --git a/tools/sdk/esp32/lib/libwapi.a b/tools/sdk/esp32/lib/libwapi.a index 2ee4b914e46..88f106bf99c 100644 Binary files a/tools/sdk/esp32/lib/libwapi.a and b/tools/sdk/esp32/lib/libwapi.a differ diff --git a/tools/sdk/esp32/lib/libwear_levelling.a b/tools/sdk/esp32/lib/libwear_levelling.a index ecdddaa6b5b..d298fc3052b 100644 Binary files a/tools/sdk/esp32/lib/libwear_levelling.a and b/tools/sdk/esp32/lib/libwear_levelling.a differ diff --git a/tools/sdk/esp32/lib/libwifi_provisioning.a b/tools/sdk/esp32/lib/libwifi_provisioning.a index 728dd8961bf..4dde5382266 100644 Binary files a/tools/sdk/esp32/lib/libwifi_provisioning.a and b/tools/sdk/esp32/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/esp32/lib/libwpa_supplicant.a b/tools/sdk/esp32/lib/libwpa_supplicant.a index a4b059e96d0..364019779c4 100644 Binary files a/tools/sdk/esp32/lib/libwpa_supplicant.a and b/tools/sdk/esp32/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/esp32/lib/libws2812_led.a b/tools/sdk/esp32/lib/libws2812_led.a index c978ad93126..c6b51b381dc 100644 Binary files a/tools/sdk/esp32/lib/libws2812_led.a and b/tools/sdk/esp32/lib/libws2812_led.a differ diff --git a/tools/sdk/esp32/lib/libxtensa.a b/tools/sdk/esp32/lib/libxtensa.a index 3e416a7cbf4..e632b5d01c1 100644 Binary files a/tools/sdk/esp32/lib/libxtensa.a and b/tools/sdk/esp32/lib/libxtensa.a differ diff --git a/tools/sdk/esp32/sdkconfig b/tools/sdk/esp32/sdkconfig index 5f1589ba0f2..89a757a8462 100644 --- a/tools/sdk/esp32/sdkconfig +++ b/tools/sdk/esp32/sdkconfig @@ -85,7 +85,6 @@ 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 is not set CONFIG_ESPTOOLPY_FLASHFREQ_40M=y # CONFIG_ESPTOOLPY_FLASHFREQ_26M is not set @@ -817,6 +816,7 @@ CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 # CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # end of Wi-Fi # @@ -937,7 +937,7 @@ CONFIG_FREERTOS_CHECK_MUTEX_GIVEN_BY_OWNER=y # CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE is not set # CONFIG_FREERTOS_PLACE_FUNCTIONS_INTO_FLASH is not set CONFIG_FREERTOS_DEBUG_OCDAWARE=y -# CONFIG_FREERTOS_FPU_IN_ISR is not set +CONFIG_FREERTOS_FPU_IN_ISR=y CONFIG_FREERTOS_ENABLE_TASK_SNAPSHOT=y # CONFIG_FREERTOS_PLACE_SNAPSHOT_FUNS_INTO_FLASH is not set # end of FreeRTOS @@ -1028,6 +1028,7 @@ CONFIG_LWIP_GARP_TMR_INTERVAL=60 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 # CONFIG_LWIP_DHCP_DOES_ARP_CHECK is not set # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y CONFIG_LWIP_DHCP_RESTORE_LAST_IP=y CONFIG_LWIP_DHCP_OPTIONS_LEN=128 @@ -1114,8 +1115,9 @@ CONFIG_LWIP_MAX_RAW_PCBS=16 # # SNTP # -CONFIG_LWIP_SNTP_MAX_SERVERS=1 -# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_MAX_SERVERS=3 +CONFIG_LWIP_DHCP_GET_NTP_SRV=y +CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP diff --git a/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin b/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin index fab20f1e4ae..43c0ae0dbe6 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_dio_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin b/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin index 77ff47eff01..b45224a6717 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin b/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin index 019833db136..295483bda5e 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_dout_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin b/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin index 163c933bf7e..0dc8cd77d92 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_dout_80m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin b/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin index 9ce756cc786..68436175ca9 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_qio_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin b/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin index b0b2c663c17..f00c99359c6 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin b/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin index cfee2de0241..2c937b5ebc9 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin and b/tools/sdk/esp32c3/bin/bootloader_qout_40m.bin differ diff --git a/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin b/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin index 9969fd07bca..de08fd6a52c 100644 Binary files a/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin and b/tools/sdk/esp32c3/bin/bootloader_qout_80m.bin differ diff --git a/tools/sdk/esp32c3/include/app_trace/include/esp_app_trace_util.h b/tools/sdk/esp32c3/include/app_trace/include/esp_app_trace_util.h index 0ee501b27fa..96595c69827 100644 --- a/tools/sdk/esp32c3/include/app_trace/include/esp_app_trace_util.h +++ b/tools/sdk/esp32c3/include/app_trace/include/esp_app_trace_util.h @@ -68,7 +68,7 @@ typedef struct { */ static inline void esp_apptrace_lock_init(esp_apptrace_lock_t *lock) { - vPortCPUInitializeMutex(&lock->mux); + portMUX_INITIALIZE(&lock->mux); lock->int_state = 0; } diff --git a/tools/sdk/esp32c3/include/config/sdkconfig.h b/tools/sdk/esp32c3/include/config/sdkconfig.h index fa982a98626..e2a47666e88 100644 --- a/tools/sdk/esp32c3/include/config/sdkconfig.h +++ b/tools/sdk/esp32c3/include/config/sdkconfig.h @@ -228,6 +228,7 @@ #define CONFIG_ESP_MAIN_TASK_AFFINITY 0x0 #define CONFIG_ESP_MINIMAL_SHARED_STACK_SIZE 2048 #define CONFIG_ESP_CONSOLE_UART_DEFAULT 1 +#define CONFIG_ESP_CONSOLE_SECONDARY_USB_SERIAL_JTAG 1 #define CONFIG_ESP_CONSOLE_UART 1 #define CONFIG_ESP_CONSOLE_UART_NUM 0 #define CONFIG_ESP_CONSOLE_UART_BAUDRATE 115200 @@ -260,6 +261,7 @@ #define CONFIG_ESP_WIFI_FTM_ENABLE 1 #define CONFIG_ESP_WIFI_FTM_INITIATOR_SUPPORT 1 #define CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 #define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1 #define CONFIG_FATFS_CODEPAGE_437 1 #define CONFIG_FATFS_CODEPAGE 437 @@ -340,6 +342,7 @@ #define CONFIG_LWIP_GARP_TMR_INTERVAL 60 #define CONFIG_LWIP_TCPIP_RECVMBOX_SIZE 32 #define CONFIG_LWIP_DHCP_DOES_ARP_CHECK 1 +#define CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID 1 #define CONFIG_LWIP_DHCP_OPTIONS_LEN 128 #define CONFIG_LWIP_DHCPS 1 #define CONFIG_LWIP_DHCPS_LEASE_UNIT 60 @@ -372,7 +375,9 @@ #define CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS 5 #define CONFIG_LWIP_ICMP 1 #define CONFIG_LWIP_MAX_RAW_PCBS 16 -#define CONFIG_LWIP_SNTP_MAX_SERVERS 1 +#define CONFIG_LWIP_SNTP_MAX_SERVERS 3 +#define CONFIG_LWIP_DHCP_GET_NTP_SRV 1 +#define CONFIG_LWIP_DHCP_MAX_NTP_SERVERS 1 #define CONFIG_LWIP_SNTP_UPDATE_DELAY 3600000 #define CONFIG_LWIP_ESP_LWIP_ASSERT 1 #define CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT 1 @@ -627,5 +632,5 @@ #define CONFIG_TIMER_TASK_STACK_SIZE CONFIG_ESP_TIMER_TASK_STACK_SIZE #define CONFIG_TOOLPREFIX CONFIG_SDK_TOOLPREFIX #define CONFIG_UDP_RECVMBOX_SIZE CONFIG_LWIP_UDP_RECVMBOX_SIZE -#define CONFIG_ARDUINO_IDF_COMMIT "6a7d83af19" +#define CONFIG_ARDUINO_IDF_COMMIT "a79dc75f0a" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32c3/include/driver/include/driver/mcpwm.h b/tools/sdk/esp32c3/include/driver/include/driver/mcpwm.h index 2a4e825f77c..fed2c3f326d 100644 --- a/tools/sdk/esp32c3/include/driver/include/driver/mcpwm.h +++ b/tools/sdk/esp32c3/include/driver/include/driver/mcpwm.h @@ -174,7 +174,6 @@ typedef enum { /** * @brief Interrupt masks for MCPWM capture */ -__attribute__ ((deprecated("please use callback function to avoid directly accessing registers"))) typedef enum { MCPWM_LL_INTR_CAP0 = BIT(27), ///< Capture 0 happened MCPWM_LL_INTR_CAP1 = BIT(28), ///< Capture 1 happened @@ -922,7 +921,6 @@ esp_err_t mcpwm_sync_invert_gpio_synchro(mcpwm_unit_t mcpwm_num, mcpwm_sync_sign * - ESP_OK Success * - ESP_ERR_INVALID_ARG Function pointer error. */ -__attribute__((deprecated("interrupt events are handled by driver, please use callback"))) esp_err_t mcpwm_isr_register(mcpwm_unit_t mcpwm_num, void (*fn)(void *), void *arg, int intr_alloc_flags, intr_handle_t *handle); diff --git a/tools/sdk/esp32c3/include/efuse/include/esp_efuse.h b/tools/sdk/esp32c3/include/efuse/include/esp_efuse.h index a44aa798720..02300ccfa72 100644 --- a/tools/sdk/esp32c3/include/efuse/include/esp_efuse.h +++ b/tools/sdk/esp32c3/include/efuse/include/esp_efuse.h @@ -6,11 +6,9 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - +#include #include + #include "esp_err.h" #include "esp_log.h" #include "soc/soc_caps.h" @@ -29,6 +27,10 @@ extern "C" { #include "esp32h2/rom/secure_boot.h" #endif +#ifdef __cplusplus +extern "C" { +#endif + #define ESP_ERR_EFUSE 0x1600 /*!< Base error code for efuse api. */ #define ESP_OK_EFUSE_CNT (ESP_ERR_EFUSE + 0x01) /*!< OK the required number of bits is set. */ #define ESP_ERR_EFUSE_CNT_IS_FULL (ESP_ERR_EFUSE + 0x02) /*!< Error field is full. */ diff --git a/tools/sdk/esp32c3/include/esp-face/include/image/dl_image.hpp b/tools/sdk/esp32c3/include/esp-face/include/image/dl_image.hpp index 4a974df063a..8e8a4df705b 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/image/dl_image.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/image/dl_image.hpp @@ -48,6 +48,15 @@ namespace dl output[2] = input & 0xF8; // red } + /** + * @brief Convert RGB565 image to RGB888 image. + * + * @param image ptr of RGB565 image + * @param image_shape shape of the input image + * @return Tensor* output RGB88 image + */ + Tensor *convert_image_rgb565_to_rgb888(uint16_t *image, std::vector &image_shape); + /** * @brief Convert RGB565 pixel to Gray. * @@ -435,5 +444,48 @@ namespace dl */ Tensor *rgb2hsv(Tensor &image, bool bgr = false, bool fast = true); + /** + * @brief resize an image to the target shape. + * + * @param image the input image Tensor + * @param target_shape the target shape of the resized image. + * @param resize_type one of IMAGE_RESIZE_BILINEAR or IMAGE_RESIZE_MEAN or IMAGE_RESIZE_NEAREST + * @return Tensor* the pointer of the resized image Tensor + */ + Tensor *resize_image(Tensor &image, std::vector target_shape, resize_type_t resize_type); + + /** + * @brief resize an image to the target shape. + * + * @param image the input image Tensor + * @param resized_image the resized image Tensor + * @param resize_type one of IMAGE_RESIZE_BILINEAR or IMAGE_RESIZE_MEAN or IMAGE_RESIZE_NEAREST + */ + void resize_image(Tensor &image, Tensor &resized_image, resize_type_t resize_type); + + /** + * @brief resize an image to the target shape with nearest method. + * + * @tparam T + * @param image the pointer of the input image + * @param input_shape the input shape of the image + * @param target_shape the target shape of the resized image + * @return T* the pointer of the resized image + */ + template + T *resize_image_nearest(T *image, std::vector input_shape, std::vector target_shape); + + /** + * @brief resize an image to the target shape with nearest method. + * + * @tparam T + * @param image the pointer of the input image + * @param input_shape the input shape of the image + * @param resized_image the pointer of the resized image + * @param target_shape the target shape of the resized image + */ + template + void resize_image_nearest(T *image, std::vector input_shape, T *resized_image, std::vector target_shape); + } // namespace image } // namespace dl diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp index 8a9aaa8dfbe..57c7fb64a9a 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp @@ -57,10 +57,10 @@ namespace dl const char *name = "AvgPool2D") : Layer(name), output_exponent(output_exponent), filter_shape(filter_shape), - padding_type(padding_type), - padding(padding), stride_y(stride_y), stride_x(stride_x), + padding_type(padding_type), + padding(padding), output_shape({}) { this->output = new Tensor; diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_expand_dims.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_expand_dims.hpp index a59bed183fb..99fdc2ed607 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_expand_dims.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_expand_dims.hpp @@ -36,7 +36,10 @@ namespace dl * false: the output will store to a separate memory */ ExpandDims(std::vector axis, const char *name = "ExpandDims", bool inplace = false) : Layer(name), - axis(axis), inplace(inplace), output_shape({}) + output_shape({}), + axis(axis), + output(NULL), + inplace(inplace) { } @@ -63,19 +66,18 @@ namespace dl this->output_exponent = input.exponent; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } this->output->set_exponent(this->output_exponent); - this->output->set_shape(this->output_shape); + this->output->set_shape(input.shape); this->output->expand_dims(this->axis); this->output->free_element(); } else { this->output = &input; - this->output->set_shape(this->output_shape); this->output->expand_dims(this->axis); } this->output_shape = this->output->shape; diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_flatten.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_flatten.hpp index 70ae483a07f..380df1a413b 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_flatten.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_flatten.hpp @@ -32,7 +32,7 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - Flatten(const char *name = "Flatten", bool inplace = false) : Layer(name), inplace(inplace), output_shape({}) + Flatten(const char *name = "Flatten", bool inplace = false) : Layer(name), output(NULL), inplace(inplace), output_shape({}) {} /** @@ -59,7 +59,7 @@ namespace dl this->output_shape = {input.get_size()}; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_leakyrelu.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_leakyrelu.hpp index a972e135006..773c62430f2 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_leakyrelu.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_leakyrelu.hpp @@ -10,14 +10,14 @@ namespace dl namespace layer { /** - * @brief LeakyReLU(input). + * @brief LeakyRelu(input). * * @tparam feature_t supports int16_t and int8_t, * - int16_t: stands for operation in int16_t quantize * - int8_t: stands for operation in int8_t quantize */ template - class LeakyReLU : public Layer + class LeakyRelu : public Layer { private: feature_t activation_alpha; /**/ @@ -28,7 +28,7 @@ namespace dl std::vector output_shape; /**/ public: /** - * @brief Construct a new LeakyReLU object + * @brief Construct a new LeakyRelu object * * @param activation_alpha quantized alpha * @param activation_exponent exponent of quantized alpha @@ -36,7 +36,7 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - LeakyReLU(const int activation_alpha, const int activation_exponent, const char *name = "LeakyReLU", bool inplace = false) : Layer(name), output(NULL), output_shape({}) + LeakyRelu(const int activation_alpha, const int activation_exponent, const char *name = "LeakyRelu", bool inplace = false) : Layer(name), output(NULL), output_shape({}) { this->activation_alpha = activation_alpha; this->activation_exponent = activation_exponent; @@ -44,10 +44,10 @@ namespace dl } /** - * @brief Destroy the LeakyReLU object + * @brief Destroy the LeakyRelu object * */ - ~LeakyReLU() + ~LeakyRelu() { if ((!this->inplace) && (this->output != NULL)) { @@ -66,7 +66,7 @@ namespace dl this->output_shape = input.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -90,7 +90,7 @@ namespace dl /** * @brief Get the output * - * @return Tensor& LeakyReLU result + * @return Tensor& LeakyRelu result */ Tensor &get_output() { @@ -98,11 +98,11 @@ namespace dl } /** - * @brief Call LeakyReLU operation. + * @brief Call LeakyRelu operation. * * @param input as an input * @param assign_core not effective yet - * @return LeakyReLU result + * @return LeakyRelu result */ Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) { @@ -130,7 +130,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::leakyrelu(*this->output, input, this->activation_alpha, this->activation_exponent, assign_core); + nn::leakyrelu(*this->output, input, this->activation_alpha, this->activation_exponent, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "leakyrelu"); } diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_max2d.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_max2d.hpp index c6be15638ab..e7defa0b08f 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_max2d.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_max2d.hpp @@ -68,7 +68,7 @@ namespace dl if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -132,7 +132,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::max2d(*this->output, input0, input1, assign_core); + nn::max2d(*this->output, input0, input1, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "max2d"); } diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_max_pool2d.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_max_pool2d.hpp index 629aa87f515..7c7fc69fa71 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_max_pool2d.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_max_pool2d.hpp @@ -53,10 +53,10 @@ namespace dl const int stride_x = 1, const char *name = "MaxPool2D") : Layer(name), filter_shape(filter_shape), - padding_type(padding_type), - padding(padding), stride_y(stride_y), stride_x(stride_x), + padding_type(padding_type), + padding(padding), output_shape({}) { this->output = new Tensor; diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_min2d.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_min2d.hpp index e38fbf3d0d2..609566348d3 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_min2d.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_min2d.hpp @@ -68,7 +68,7 @@ namespace dl if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -132,7 +132,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::min2d(*this->output, input0, input1, assign_core); + nn::min2d(*this->output, input0, input1, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "min2d"); } diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_mul2d.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_mul2d.hpp index 21bcca7a81e..a391c790335 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_mul2d.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_mul2d.hpp @@ -75,7 +75,7 @@ namespace dl if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -140,7 +140,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::mul2d(*this->output, input0, input1, this->activation, assign_core); + nn::mul2d(*this->output, input0, input1, this->activation, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "mul2d"); } diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_prelu.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_prelu.hpp index 96168a783b1..2141e986646 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_prelu.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_prelu.hpp @@ -10,17 +10,17 @@ namespace dl namespace layer { /** - * @brief PReLU(input). + * @brief PRelu(input). * * @tparam feature_t supports int16_t and int8_t, * - int16_t: stands for operation in int16_t quantize * - int8_t: stands for operation in int8_t quantize */ template - class PReLU : public Layer + class PRelu : public Layer { private: - feature_t *activation_element; /**/ + const feature_t *activation_element; /**/ int activation_exponent; /**/ Tensor *output; /**/ bool inplace; /* output_shape; /**/ public: /** - * @brief Construct a new PReLU object + * @brief Construct a new PRelu object * * @param activation_element quantized alpha elements along channel axis * @param activation_exponent exponent of quantized alpha elements @@ -36,10 +36,10 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - PReLU(const feature_t *activation_element, + PRelu(const feature_t *activation_element, const int activation_exponent = 0, - const char *name = NULL, - bool inplace = "PReLU") : Layer(name), + const char *name = "PRelu", + bool inplace = false) : Layer(name), activation_element(activation_element), activation_exponent(activation_exponent), output(NULL), @@ -49,10 +49,10 @@ namespace dl } /** - * @brief Destroy the PReLU object + * @brief Destroy the PRelu object * */ - ~PReLU() + ~PRelu() { if ((!this->inplace) && (this->output != NULL)) { @@ -71,7 +71,7 @@ namespace dl this->output_shape = input.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -94,7 +94,7 @@ namespace dl /** * @brief Get the output * - * @return Tensor& PReLU result + * @return Tensor& PRelu result */ Tensor &get_output() { @@ -102,11 +102,11 @@ namespace dl } /** - * @brief Call PReLU operation. + * @brief Call PRelu operation. * * @param input as an input * @param assign_core not effective yet - * @return PReLU result + * @return PRelu result */ Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) { @@ -125,7 +125,7 @@ namespace dl DL_LOG_LAYER_LATENCY_START(); nn::prelu(*this->output, input, this->activation_element, this->activation_exponent, assign_core); - DL_LOG_LAYER_LATENCY_END(this->name, "leakyrelu"); + DL_LOG_LAYER_LATENCY_END(this->name, "prelu"); } else { @@ -135,7 +135,7 @@ namespace dl this->output->set_shape(this->output_shape); } nn::prelu(*this->output, input, this->activation_element, this->activation_exponent, assign_core); - DL_LOG_LAYER_LATENCY_END(this->name, "leakyrelu"); + DL_LOG_LAYER_LATENCY_END(this->name, "prelu"); } return *this->output; diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_relu.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_relu.hpp index 7dd29d4a178..dff05c7f420 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_relu.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_relu.hpp @@ -18,7 +18,7 @@ namespace dl * - int8_t: stands for operation in int8_t quantize */ template - class ReLU : public Layer + class Relu : public Layer { private: Tensor *output; /**/ @@ -33,7 +33,7 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - ReLU(const char *name = "ReLU", bool inplace = false) : Layer(name), + Relu(const char *name = "Relu", bool inplace = false) : Layer(name), output(NULL), inplace(inplace), output_shape({}) { } @@ -42,7 +42,7 @@ namespace dl * @brief Destroy the ReLU object * */ - ~ReLU() + ~Relu() { if ((!this->inplace) && (this->output != NULL)) { @@ -61,7 +61,7 @@ namespace dl this->output_shape = input.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_reshape.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_reshape.hpp index 3f2ed72b6e0..2ef76ef96d8 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_reshape.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_reshape.hpp @@ -35,7 +35,9 @@ namespace dl * false: the output will store to a separate memory */ Reshape(std::vector shape, const char *name = "Reshape", bool inplace = false) : Layer(name), - output_shape(shape), inplace(inplace) + output(NULL), + inplace(inplace), + output_shape(shape) { } @@ -62,19 +64,21 @@ namespace dl this->output_exponent = input.exponent; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } this->output->set_exponent(this->output_exponent); - this->output->set_shape(this->output_shape); + this->output->set_shape(input.shape); + this->output->reshape(this->output_shape); this->output->free_element(); } else { this->output = &input; - this->output->set_shape(this->output_shape); + this->output->reshape(this->output_shape); } + this->output_shape = this->output->shape; if (print_shape) { diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_squeeze.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_squeeze.hpp index cee92f22764..710901a3d02 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_squeeze.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_squeeze.hpp @@ -35,7 +35,11 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - Squeeze(int axis = INT32_MAX, const char *name = "Squeeze", bool inplace = false) : Layer(name), axis(axis), inplace(inplace), output_shape({}) + Squeeze(int axis = INT32_MAX, const char *name = "Squeeze", bool inplace = false) : Layer(name), + output(NULL), + inplace(inplace), + axis(axis), + output_shape({}) { } @@ -62,7 +66,7 @@ namespace dl this->output_exponent = input.exponent; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -74,7 +78,6 @@ namespace dl else { this->output = &input; - this->output->set_shape(input.shape); this->output->squeeze(this->axis); } this->output_shape = this->output->shape; diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_sub2d.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_sub2d.hpp index da03b4aad85..61bcc9f2804 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_sub2d.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_sub2d.hpp @@ -38,7 +38,11 @@ namespace dl * false: the output will store to a separate memory */ Sub2D(const int output_exponent, const Activation *activation = NULL, const char *name = "Sub2D", bool inplace = false) : Layer(name), - output_exponent(output_exponent), activation(activation), output(NULL), inplace(inplace), output_shape({}) + output_exponent(output_exponent), + activation(activation), + output(NULL), + inplace(inplace), + output_shape({}) { } @@ -67,7 +71,7 @@ namespace dl this->output_shape = input0.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -116,12 +120,12 @@ namespace dl { this->output->set_shape(this->output_shape); } - this->output.malloc_element(); + this->output->malloc_element(); this->output->set_exponent(input0.exponent); DL_LOG_LAYER_LATENCY_END(this->name, "apply"); DL_LOG_LAYER_LATENCY_START(); - nn::sub2d(this->output, input0, input1, this->activation, assign_core); + nn::sub2d(*this->output, input0, input1, this->activation, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "sub2d"); } else @@ -131,7 +135,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::sub2d(this->output, input0, input1, this->activation, assign_core, this->output_exponent); + nn::sub2d(*this->output, input0, input1, this->activation, assign_core, this->output_exponent); DL_LOG_LAYER_LATENCY_END(this->name, "sub2d"); } return *this->output; diff --git a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_transpose.hpp b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_transpose.hpp index d89ba8daed5..87e9cce5ce4 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_transpose.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/layer/dl_layer_transpose.hpp @@ -33,7 +33,11 @@ namespace dl * @param inplace true: the output will store to input * false: the output will store to a separate memory */ - Transpose(std::vector perm = {}, const char *name = "Transpose", bool inplace = false) : Layer(name), perm(perm), inplace(inplace), output_shape({}) + Transpose(std::vector perm = {}, const char *name = "Transpose", bool inplace = false) : Layer(name), + output(NULL), + inplace(inplace), + perm(perm), + output_shape({}) { } @@ -59,13 +63,24 @@ namespace dl { this->output_exponent = input.exponent; this->output_shape = input.shape; - for (int i = 0; i < this->perm.size(); i++) + int dims = this->output_shape.size(); + if (this->perm.size() == 0) { + for (int i = dims - 1; i >= 0; i--) + { + this->perm.push_back(i); + } + } + for (int i = 0; i < dims; ++i) + { + if (this->perm[i] < 0) + this->perm[i] = dims + this->perm[i]; this->output_shape[i] = input.shape[this->perm[i]]; } + if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } diff --git a/tools/sdk/esp32c3/include/esp-face/include/model_zoo/color_detector.hpp b/tools/sdk/esp32c3/include/esp-face/include/model_zoo/color_detector.hpp index 063ab20b34a..f79f98c0fd2 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/model_zoo/color_detector.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/model_zoo/color_detector.hpp @@ -7,46 +7,143 @@ typedef struct int area; /*!< Area of connected domains >*/ std::vector center; /**/ std::vector box; /**/ -} components_stats_t; +} color_detect_result_t; + +typedef struct +{ + std::vector start_col; + std::vector end_col; + std::vector row; + std::vector index; + std::vector area; +} color_segment_result_t; + +typedef struct +{ + std::vector color_thresh; /*!< threshold of colors, The threshold of each color is composed of 6 numbers >*/ + int area_thresh; /*!< the area threshold of each color, + the area that is smaller than the threshold is filtered >*/ + std::string name; /*!*/ +} color_info_t; class ColorDetector { private: - std::vector> results; /*!< detection results >*/ - -public: - std::vector> color_thresh; /*!< threshold of colors, The threshold of each color is composed of 6 numbers >*/ - std::vector area_thresh; /*!< the area threshold of each color, - the area that is smaller than the threshold is filtered >*/ - bool bgr; /*!< true: the input image is in BGR format + std::vector> detection_results; /*!< detection results >*/ + std::vector segmentation_results; /*!< segmentation results >*/ + std::vector registered_colors; /*!< the infomation of registered colors >*/ + std::vector color_thresh_offset; /*!< HSV offset of the registered colors>*/ + std::vector detection_shape; /*!< the inference shape of images, the input image will be resized to this shape. + if the shape == {}, the input image will not be resized >*/ + bool bgr; /*!< true: the input image is in BGR format false: the input image is in RGB format >*/ + int id_nums; /*!< the number of registered colors in history>*/ + float h_ratio; + float w_ratio; + void color_detection_forward(dl::Tensor &bin, int area_thresh); +public: /** * @brief get the color threshold of rectangular region in the image * - * @param image the input image + * @param image the input image in RGB888 format. * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] * @return std::vector the threshold. */ std::vector cal_color_thresh(dl::Tensor &image, std::vector box); + /** + * @brief get the color threshold of rectangular region in the image + * + * @param input the ptr of RGB565 image. + * @param input_shape shape of the input image. + * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] + * @return std::vector the threshold. + */ + std::vector cal_color_thresh(uint16_t *input, std::vector input_shape, std::vector box); + + /** + * @brief register a new color to the color detector + * + * @param image the input image in RGB888 format. + * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] + * @param area_thresh the area threshold of the color + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int register_color(dl::Tensor &image, std::vector box, int area_thresh = 256, std::string color_name = "", int id = -1); + + /** + * @brief register a new color to the color detector + * + * @param input the ptr of RGB565 image. + * @param input_shape shape of the input image. + * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] + * @param area_thresh the area threshold of the color + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int register_color(uint16_t *input, std::vector input_shape, std::vector box, int area_thresh = 256, std::string color_name = "", int id = -1); + + /** + * @brief register a new color to the color detector + * + * @param color_thresh the color threshold + * @param area_thresh the area threshold of the color + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int register_color(std::vector color_thresh, int area_thresh = 256, std::string color_name = "", int id = -1); + + /** + * @brief delete a registered color + * + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int delete_color(int id = -1); + + /** + * @brief delete a registered color + * + * @param color_name name of the registered_color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int delete_color(std::string color_name); + + /** + * @brief delete all the registered colors + * + */ + void clear_color(); + /** * @brief detect the colors based on the color thresholds * * @param image the input image. - * @return std::vector>& detection result. + * @return std::vector>& detection result. + */ + std::vector> &detect(dl::Tensor &image, std::vector color_ids = {}); + + /** + * @brief + * + * @param input + * @param input_shape + * @return std::vector>& */ - std::vector> &detect(dl::Tensor &image); + std::vector> &detect(uint16_t *input_shape, std::vector shape, std::vector color_ids = {}); /** * @brief Construct a new Color Detector object * - * @param color_thresh threshold of colors, The threshold of each color is composed of 6 numbers - * @param area_thresh the area threshold of each color,the area that is smaller than the threshold is filtered + * @param color_thresh_offset HSV offset of the registered colors> + * @param detection_shape the inference shape of images, the input image will be resized to this shape * @param bgr true: the input image is in BGR format * false: the input image is in RGB format */ - ColorDetector(std::vector> color_thresh, std::vector area_thresh, bool bgr = false) : color_thresh(color_thresh), area_thresh(area_thresh), bgr(bgr) + ColorDetector(std::vector color_thresh_offset = {}, std::vector detection_shape = {}, bool bgr = true) : color_thresh_offset(color_thresh_offset), + detection_shape(detection_shape), bgr(bgr), id_nums(0) { } @@ -57,12 +154,213 @@ class ColorDetector ~ColorDetector() {} /** - * @brief Get the results object + * @brief Get the detection results object + * + * @return std::vector>& the detection result. + */ + std::vector> &get_detection_results() + { + return this->detection_results; + } + + /** + * @brief Get the segmentation results object * - * @return std::vector>& the detection result. + * @return std::vector& the segmentation result. */ - std::vector> &get_results() + std::vector &get_segmentation_results() { - return this->results; + return this->segmentation_results; } + + /** + * @brief Get the registered colors object + * + * @return std::vector the information of resgistered colors + */ + std::vector get_registered_colors() + { + return this->registered_colors; + } + + /** + * @brief Set the color thresh offset object + * + * @param color_thresh_offset the offset of color thresh for registered colors + * @return ColorDetector& + */ + ColorDetector &set_color_thresh_offset(std::vector color_thresh_offset) + { + assert(color_thresh_offset.size() == 3); + this->color_thresh_offset = color_thresh_offset; + return *this; + } + + /** + * @brief Get the color thresh offset object + * + * @return std::vector color_thresh_offset + */ + std::vector get_color_thresh_offset() + { + return this->color_thresh_offset; + } + + /** + * @brief Set the area thresh object + * + * @param area_thresh the area thresh for each registered colors + * @return ColorDetector& + */ + ColorDetector &set_area_thresh(std::vector area_thresh) + { + assert((area_thresh.size() == this->registered_colors.size()) || (area_thresh.size() == 1)); + if (area_thresh.size() == 1) + { + for (int i = 0; i < this->registered_colors.size(); ++i) + { + this->registered_colors[i].area_thresh = area_thresh[0]; + } + } + else + { + for (int i = 0; i < this->registered_colors.size(); ++i) + { + this->registered_colors[i].area_thresh = area_thresh[i]; + } + } + return *this; + } + + /** + * @brief Set the area thresh object + * + * @param area_thresh the area thresh for each registered colors + * @param id index of the registered color + * @return ColorDetector& + */ + ColorDetector &set_area_thresh(int area_thresh, int id) + { + assert((id >= 0) && (id < this->registered_colors.size())); + this->registered_colors[id].area_thresh = area_thresh; + return *this; + } + + /** + * @brief Set the bgr object + * + * @param bgr + * @return ColorDetector& + */ + ColorDetector &set_bgr(bool bgr) + { + this->bgr = bgr; + return *this; + } + + /** + * @brief Get the bgr object + * + * @return bool bgr flag + */ + bool get_bgr() + { + return this->bgr; + } + + /** + * @brief Get the detection shape object + * + * @return std::vector + */ + std::vector get_detection_shape() + { + return this->detection_shape; + } + + /** + * @brief Set the detection shape object + * + * @param detection_shape the inference shape of images, the input image will be resized to this shape + * @return ColorDetector& + */ + ColorDetector &set_detection_shape(std::vector detection_shape) + { + assert(detection_shape.size() == 3); + this->detection_shape = detection_shape; + return *this; + } + + /** + * @brief Get the registered colors num + * + * @return int the registered colors num + */ + int get_registered_colors_num() + { + return this->registered_colors.size(); + } + + /** + * @brief print the detection detection results + * + * @param tag + */ + void print_detection_results(const char *tag = "RGB") + { + printf("\n%s | color detection result:\n", tag); + for (int i = 0; i < this->detection_results.size(); ++i) + { + printf("color %d: detected box :%d\n", i, this->detection_results[i].size()); + for (int j = 0; j < this->detection_results[i].size(); ++j) + { + printf("center: (%d, %d)\n", this->detection_results[i][j].center[0], this->detection_results[i][j].center[1]); + printf("box: (%d, %d), (%d, %d)\n", this->detection_results[i][j].box[0], this->detection_results[i][j].box[1], this->detection_results[i][j].box[2], this->detection_results[i][j].box[3]); + printf("area: %d\n", this->detection_results[i][j].area); + } + printf("\n"); + } + } + + /** + * @brief print the segmentation results + * + * @param tag + */ + void print_segmentation_results(const char *tag = "RGB") + { + printf("\n%s | color segmentation result:\n", tag); + for (int i = 0; i < this->segmentation_results.size(); ++i) + { + printf("color %d: detected box :%d\n", i, this->detection_results[i].size()); + for (int j = 0; j < this->segmentation_results[i].index.size(); ++j) + { + printf("box_index: %d, start col: %d, end col: %d, row: %d, area: %d\n", + this->segmentation_results[i].index[j], this->segmentation_results[i].start_col[j], this->segmentation_results[i].end_col[j], + this->segmentation_results[i].row[j], this->segmentation_results[i].area[j]); + } + printf("\n"); + } + } + + /** + * @brief draw the color segmentation result on the input image + * + * @param image the input RGB image + * @param draw_colors RGB values for each detected colors + * @param draw_backgound draw the background if it is true + * @param background_color RGB values for the background color + */ + void draw_segmentation_results(dl::Tensor &image, std::vector> draw_colors, bool draw_backgound = true, std::vector background_color = {0, 0, 0}); + + /** + * @brief draw the color segmentation result on the input image + * + * @param image the pointer of the input RGB565 image + * @param image_shape the shape of the input image + * @param draw_colors RGB565 values for each detected colors + * @param draw_backgound draw the background if it is true + * @param background_color RGB565 values for the background color + */ + void draw_segmentation_results(uint16_t *image, std::vector image_shape, std::vector draw_colors, bool draw_backgound = true, uint16_t background_color = 0x0000); }; \ No newline at end of file diff --git a/tools/sdk/esp32c3/include/esp-face/include/model_zoo/face_recognition_tool.hpp b/tools/sdk/esp32c3/include/esp-face/include/model_zoo/face_recognition_tool.hpp index 2226d32daf9..3adf1f62f72 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/model_zoo/face_recognition_tool.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/model_zoo/face_recognition_tool.hpp @@ -10,6 +10,7 @@ #include #include #include +#include "esp_partition.h" /** * @brief struct of face similarity @@ -45,6 +46,13 @@ class FaceID */ FaceID(int id, dl::Tensor &id_emb, std::string name = ""); + /** + * @brief Construct a new Face ID which is same as input face_id + * + * @param face_id input face_id + */ + FaceID(FaceID &face_id); + /** * @brief Destroy the Face ID object * diff --git a/tools/sdk/esp32c3/include/esp-face/include/model_zoo/face_recognizer.hpp b/tools/sdk/esp32c3/include/esp-face/include/model_zoo/face_recognizer.hpp index 864881c984a..0f6b854118b 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/model_zoo/face_recognizer.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/model_zoo/face_recognizer.hpp @@ -148,7 +148,7 @@ class FaceRecognizer * @param name name of the face id. * @return int the face id index of the enrolled embedding. */ - int enroll_id(uint16_t *image_input, std::vector shape, std::vector &landmarks, std::string name=""); + int enroll_id(uint16_t *image_input, std::vector shape, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id @@ -158,9 +158,11 @@ class FaceRecognizer * @param aligned_face the Tensor to store the intermeidate aligned face. * @param landmarks face landmarks coordinates * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(uint16_t *image_input, std::vector shape, Tensor &aligned_face, std::vector &landmarks, std::string name=""); + int enroll_id(uint16_t *image_input, std::vector shape, Tensor &aligned_face, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id @@ -168,9 +170,11 @@ class FaceRecognizer * @param image_input the Tensor of input image with format bgr888. * @param landmarks face landmarks coordinates * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &image_input, std::vector &landmarks, std::string name=""); + int enroll_id(Tensor &image_input, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id @@ -179,42 +183,114 @@ class FaceRecognizer * @param aligned_face the Tensor to store the intermeidate aligned face. * @param landmarks face landmarks coordinates * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &image_input, Tensor &aligned_face, std::vector &landmarks, std::string name=""); + int enroll_id(Tensor &image_input, Tensor &aligned_face, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id * * @param aligned_face the Tensor of the input aligned face with format bgr888. * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &aligned_face, std::string name=""); + int enroll_id(Tensor &aligned_face, std::string name="", bool update_flash = false); /** * @brief enroll the normalzied face embedding. * - * @param emb the normalized face embbeding. - * @param name name of the face id. - * @return int the face id index of the enrolled embedding. + * @param emb the normalized face embbeding. + * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash + * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &emb, std::string name=""); + int enroll_id(Tensor &emb, std::string name="", bool update_flash = false); /** - * @brief delete the last enrolled face id. + * @brief delete the last enrolled face id. + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash * * @return int the number of remained face ids. * if the face ids list is empty, return -1 */ - int delete_id(); + int delete_id(bool update_flash = false); /** - * @brief delete the face id with id index. + * @brief delete the face id with id index. * - * @param id face id index. - * @return int the number of remained face ids. - * if there is no matched id return -1 + * @param id face id index. + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash + * @return int the number of remained face ids. + * if there is no matched id return -1 + */ + int delete_id(int id, bool update_flash = false); + + /** + * @brief Set the enrolled ids + * + * @param ids the ids to be set + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash + * @return int the number of enrolled ids. + */ + int set_ids(std::vector *> &ids, bool update_flash = false); + + /** + * @brief Set the enrolled ids from flash + * + * @return int the number of enrolled ids. + */ + int set_ids_from_flash(); + + /** + * @brief write the enrolled ids to flash + * + * @return int the number of enrolled ids. */ - int delete_id(int id); + int write_ids_to_flash(); + + /** + * @brief Get the enrolled ids with name object + * + * @param name + * @return std::vector + */ + std::vector get_enrolled_ids_with_name(std::string name); + + /** + * @brief Check whether the Flash partition is available + * + * @return int -2: the partition has not been set + * -1: the data in the flash does not match the current model. + * model_check_code: the Flash partition is available. + * number of ids in flash: The IDs in Flash and RAM does not sync. + */ + int check_partition(); + + /** + * @brief delete all the enrolled face ids. + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash + * + */ + void clear_id(bool update_flash = false); + + /** + * @brief Set the partition for saving face ids to flash or reading face ids from flash. + * + * @param type esp_partition_type + * @param subtype esp_partition_subtype + * @param label the partition label + * @return int 0: set the partition failed + * 1: set the partition successfully + */ + int set_partition(esp_partition_type_t type, esp_partition_subtype_t subtype, const char *label); + }; \ No newline at end of file diff --git a/tools/sdk/esp32c3/include/esp-face/include/typedef/dl_constant.hpp b/tools/sdk/esp32c3/include/esp-face/include/typedef/dl_constant.hpp index 07b2dd24ee1..a111817e3d6 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/typedef/dl_constant.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/typedef/dl_constant.hpp @@ -2,6 +2,7 @@ #include "dl_define.hpp" #include +#include namespace dl { @@ -48,10 +49,11 @@ namespace dl /**/ std::vector shape_with_dilation; /**/ /**/ - std::vector channel_exponent; /**/ + const int8_t* channel_exponent; /**/ + const int channel_exponent_size; /** - * @brief Construct a new Filter object. + * @brief Construct a new Filter object. * * @param element point to element * @param exponent exponent of element @@ -66,16 +68,17 @@ namespace dl Filter(const T *element, const int exponent, const std::vector shape, const std::vector dilation = {1, 1}); /** - * @brief Construct a new Filter object. + * @brief Construct a new Filter object. it is only avaliable to int16_t * - * @param element point to element - * @param channel_exponent exponent for per-channel - * @param shape shape of element - * @param dilation dilation of Filter - * - 1D: reserved - * - 2D: [dilation_in_height, dilation_in_width] + * @param element point to element + * @param channel_exponent exponent for per-channel + * @param channel_exponent_size size of exponent + * @param shape shape of element + * @param dilation dilation of Filter + * - 1D: reserved + * - 2D: [dilation_in_height, dilation_in_width] */ - Filter(const T *element, const std::vector channel_exponent, const std::vector shape, const std::vector dilation = {1, 1}); + Filter(const T *element, const int8_t* channel_exponent, const int channel_exponent_size, const std::vector shape, const std::vector dilation = {1, 1}); /** * @brief Print the n-th filter. @@ -98,9 +101,6 @@ namespace dl { public: using Constant::Constant; - std::vector channel_exponent; /**/ - - Bias(const T *element, const std::vector channel_exponent, const std::vector shape); }; /** diff --git a/tools/sdk/esp32c3/include/esp-face/include/typedef/dl_variable.hpp b/tools/sdk/esp32c3/include/esp-face/include/typedef/dl_variable.hpp index 471b3028f1a..118f6430575 100644 --- a/tools/sdk/esp32c3/include/esp-face/include/typedef/dl_variable.hpp +++ b/tools/sdk/esp32c3/include/esp-face/include/typedef/dl_variable.hpp @@ -396,9 +396,6 @@ namespace dl * @brief print all the element of the Tensor. * * @param message to print - * @param with_padding one of true or false, - * - true: the padding element will also be ed - * - false: the padding element will not be ed */ void print_all(const char *message = "") { @@ -553,4 +550,4 @@ namespace dl return output; } }; -} // namespace dl \ No newline at end of file +} // namespace dl diff --git a/tools/sdk/esp32c3/include/esp_http_client/include/esp_http_client.h b/tools/sdk/esp32c3/include/esp_http_client/include/esp_http_client.h index 820c4168f66..d1b530a42e3 100644 --- a/tools/sdk/esp32c3/include/esp_http_client/include/esp_http_client.h +++ b/tools/sdk/esp32c3/include/esp_http_client/include/esp_http_client.h @@ -344,6 +344,17 @@ esp_err_t esp_http_client_set_password(esp_http_client_handle_t client, const ch */ esp_err_t esp_http_client_set_authtype(esp_http_client_handle_t client, esp_http_client_auth_type_t auth_type); +/** + * @brief Get HTTP client session errno + * + * @param[in] client The esp_http_client handle + * + * @return + * - (-1) if invalid argument + * - errno + */ +int esp_http_client_get_errno(esp_http_client_handle_t client); + /** * @brief Set http request method * diff --git a/tools/sdk/esp32c3/include/esp_hw_support/include/soc/spinlock.h b/tools/sdk/esp32c3/include/esp_hw_support/include/soc/spinlock.h index 97cc9e514ab..fbeff5054b4 100644 --- a/tools/sdk/esp32c3/include/esp_hw_support/include/soc/spinlock.h +++ b/tools/sdk/esp32c3/include/esp_hw_support/include/soc/spinlock.h @@ -52,6 +52,15 @@ static inline void __attribute__((always_inline)) spinlock_initialize(spinlock_t /** * @brief Top level spinlock acquire function, spins until get the lock + * + * This function will: + * - Save current interrupt state, then disable interrupts + * - Spin until lock is acquired or until timeout occurs + * - Restore interrupt state + * + * @note Spinlocks alone do no constitute true critical sections (as this + * function reenables interrupts once the spinlock is acquired). For critical + * sections, use the interface provided by the operating system. * @param lock - target spinlock object * @param timeout - cycles to wait, passing SPINLOCK_WAIT_FOREVER blocs indefinitely */ @@ -125,6 +134,15 @@ static inline bool __attribute__((always_inline)) spinlock_acquire(spinlock_t *l /** * @brief Top level spinlock unlock function, unlocks a previously locked spinlock + * + * This function will: + * - Save current interrupt state, then disable interrupts + * - Release the spinlock + * - Restore interrupt state + * + * @note Spinlocks alone do no constitute true critical sections (as this + * function reenables interrupts once the spinlock is acquired). For critical + * sections, use the interface provided by the operating system. * @param lock - target, locked before, spinlock object */ static inline void __attribute__((always_inline)) spinlock_release(spinlock_t *lock) diff --git a/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_commands.h b/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_commands.h new file mode 100644 index 00000000000..091ef1cffef --- /dev/null +++ b/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_commands.h @@ -0,0 +1,54 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once + +/* Common LCD panel commands */ +#define LCD_CMD_NOP 0x00 // This command is empty command +#define LCD_CMD_SWRESET 0x01 // Software reset registers (the built-in frame buffer is not affected) +#define LCD_CMD_RDDID 0x04 // Read 24-bit display ID +#define LCD_CMD_RDDST 0x09 // Read display status +#define LCD_CMD_RDDPM 0x0A // Read display power mode +#define LCD_CMD_RDD_MADCTL 0x0B // Read display MADCTL +#define LCD_CMD_RDD_COLMOD 0x0C // Read display pixel format +#define LCD_CMD_RDDIM 0x0D // Read display image mode +#define LCD_CMD_RDDSM 0x0E // Read display signal mode +#define LCD_CMD_RDDSR 0x0F // Read display self-diagnostic result +#define LCD_CMD_SLPIN 0x10 // Go into sleep mode (DC/DC, oscillator, scanning stopped, but memory keeps content) +#define LCD_CMD_SLPOUT 0x11 // Exit sleep mode +#define LCD_CMD_PTLON 0x12 // Turns on partial display mode +#define LCD_CMD_NORON 0x13 // Turns on normal display mode +#define LCD_CMD_INVOFF 0x20 // Recover from display inversion mode +#define LCD_CMD_INVON 0x21 // Go into display inversion mode +#define LCD_CMD_GAMSET 0x26 // Select Gamma curve for current display +#define LCD_CMD_DISPOFF 0x28 // Display off (disable frame buffer output) +#define LCD_CMD_DISPON 0x29 // Display on (enable frame buffer output) +#define LCD_CMD_CASET 0x2A // Set column address +#define LCD_CMD_RASET 0x2B // Set row address +#define LCD_CMD_RAMWR 0x2C // Write frame memory +#define LCD_CMD_RAMRD 0x2E // Read frame memory +#define LCD_CMD_PTLAR 0x30 // Define the partial area +#define LCD_CMD_VSCRDEF 0x33 // Vertical scrolling definition +#define LCD_CMD_TEOFF 0x34 // Turns of tearing effect +#define LCD_CMD_TEON 0x35 // Turns on tearing effect + +#define LCD_CMD_MADCTL 0x36 // Memory data access control +#define LCD_CMD_MH_BIT (1 << 2) // Display data latch order, 0: refresh left to right, 1: refresh right to left +#define LCD_CMD_BGR_BIT (1 << 3) // RGB/BGR order, 0: RGB, 1: BGR +#define LCD_CMD_ML_BIT (1 << 4) // Line address order, 0: refresh top to bottom, 1: refresh bottom to top +#define LCD_CMD_MV_BIT (1 << 5) // Row/Column order, 0: normal mode, 1: reverse mode +#define LCD_CMD_MX_BIT (1 << 6) // Column address order, 0: left to right, 1: right to left +#define LCD_CMD_MY_BIT (1 << 7) // Row address order, 0: top to bottom, 1: bottom to top + +#define LCD_CMD_VSCSAD 0x37 // Vertical scroll start address +#define LCD_CMD_IDMOFF 0x38 // Recover from IDLE mode +#define LCD_CMD_IDMON 0x39 // Fall into IDLE mode (8 color depth is displayed) +#define LCD_CMD_COLMOD 0x3A // Defines the format of RGB picture data +#define LCD_CMD_RAMWRC 0x3C // Memory write continue +#define LCD_CMD_RAMRDC 0x3E // Memory read continue +#define LCD_CMD_STE 0x44 // Set tear scanline, tearing effect output signal when display module reaches line N +#define LCD_CMD_GDCAN 0x45 // Get scanline +#define LCD_CMD_WRDISBV 0x51 // Write display brightness +#define LCD_CMD_RDDISBV 0x52 // Read display brightness value diff --git a/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_rgb.h b/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_rgb.h index 1368bb787f6..0c264545ee2 100644 --- a/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_rgb.h +++ b/tools/sdk/esp32c3/include/esp_lcd/include/esp_lcd_panel_rgb.h @@ -18,10 +18,10 @@ extern "C" { #if SOC_LCD_RGB_SUPPORTED /** * @brief LCD RGB timing structure - * + * @verbatim * Total Width * <---------------------------------------------------> - * Hsync width HBP Active Width HFP + * HSYNC width HBP Active Width HFP * <---><--><--------------------------------------><---> * ____ ____|_______________________________________|____| * |___| | | | @@ -36,7 +36,7 @@ extern "C" { * | /|\ | | / / / / / / / / / / / / / / / / / / / | | * | | | |/ / / / / / / / / / / / / / / / / / / /| | * Total | | | |/ / / / / / / / / / / / / / / / / / / /| | - * Heigh | | | |/ / / / / / / / / / / / / / / / / / / /| | + * Height | | | |/ / / / / / / / / / / / / / / / / / / /| | * |Active| | |/ / / / / / / / / / / / / / / / / / / /| | * |Heigh | | |/ / / / / / Active Display Area / / / /| | * | | | |/ / / / / / / / / / / / / / / / / / / /| | @@ -48,7 +48,7 @@ extern "C" { * | /|\ | | * | VFP | | | * \|/ \|/_____|______________________________________________________| - * + * @endverbatim */ typedef struct { unsigned int pclk_hz; /*!< Frequency of pixel clock */ @@ -65,7 +65,7 @@ typedef struct { unsigned int vsync_idle_low: 1; /*!< The vsync signal is low in IDLE state */ unsigned int de_idle_high: 1; /*!< The de signal is high in IDLE state */ unsigned int pclk_active_neg: 1; /*!< The display will write data lines when there's a falling edge on PCLK */ - unsigned int pclk_idle_low: 1; /*!< The PCLK stays at low level in IDLE phase */ + unsigned int pclk_idle_high: 1; /*!< The PCLK stays at high level in IDLE phase */ } flags; } esp_lcd_rgb_timing_t; diff --git a/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_defaults.h b/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_defaults.h index da01500db1c..b8276068e9a 100644 --- a/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_defaults.h +++ b/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_defaults.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_NETIF_DEFAULTS_H #define _ESP_NETIF_DEFAULTS_H @@ -37,6 +29,7 @@ extern "C" { .route_prio = 100 \ } \ +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT #define ESP_NETIF_INHERENT_DEFAULT_WIFI_AP() \ { \ .flags = (esp_netif_flags_t)(ESP_NETIF_DHCP_SERVER | ESP_NETIF_FLAG_AUTOUP), \ @@ -48,6 +41,7 @@ extern "C" { .if_desc = "ap", \ .route_prio = 10 \ }; +#endif #define ESP_NETIF_INHERENT_DEFAULT_ETH() \ { \ @@ -108,6 +102,7 @@ extern "C" { .stack = ESP_NETIF_NETSTACK_DEFAULT_ETH, \ } +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT /** * @brief Default configuration reference of WIFI AP */ @@ -117,6 +112,7 @@ extern "C" { .driver = NULL, \ .stack = ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP, \ } +#endif /** * @brief Default configuration reference of WIFI STA @@ -154,10 +150,12 @@ extern "C" { */ #define ESP_NETIF_BASE_DEFAULT_WIFI_STA &_g_esp_netif_inherent_sta_config +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT /** * @brief Default base config (esp-netif inherent) of WIFI AP */ #define ESP_NETIF_BASE_DEFAULT_WIFI_AP &_g_esp_netif_inherent_ap_config +#endif /** * @brief Default base config (esp-netif inherent) of ethernet interface @@ -177,7 +175,9 @@ extern "C" { #define ESP_NETIF_NETSTACK_DEFAULT_ETH _g_esp_netif_netstack_default_eth #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA _g_esp_netif_netstack_default_wifi_sta +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP _g_esp_netif_netstack_default_wifi_ap +#endif #define ESP_NETIF_NETSTACK_DEFAULT_PPP _g_esp_netif_netstack_default_ppp #define ESP_NETIF_NETSTACK_DEFAULT_SLIP _g_esp_netif_netstack_default_slip #define ESP_NETIF_NETSTACK_DEFAULT_OPENTHREAD _g_esp_netif_netstack_default_openthread @@ -190,7 +190,9 @@ extern "C" { // extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_eth; extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_sta; +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_ap; +#endif extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_ppp; extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_slip; @@ -200,12 +202,16 @@ extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_slip; // common behavioural patterns for common interfaces such as STA, AP, ETH, PPP // extern const esp_netif_inherent_config_t _g_esp_netif_inherent_sta_config; +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ap_config; +#endif extern const esp_netif_inherent_config_t _g_esp_netif_inherent_eth_config; extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ppp_config; extern const esp_netif_inherent_config_t _g_esp_netif_inherent_slip_config; +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT extern const esp_netif_ip_info_t _g_esp_netif_soft_ap_ip; +#endif #if CONFIG_OPENTHREAD_ENABLED /** diff --git a/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_types.h b/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_types.h index b302e49e3ad..cc7a37b9c49 100644 --- a/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_types.h +++ b/tools/sdk/esp32c3/include/esp_netif/include/esp_netif_types.h @@ -79,6 +79,8 @@ typedef enum{ ESP_NETIF_REQUESTED_IP_ADDRESS = 50, /**< Request specific IP address */ ESP_NETIF_IP_ADDRESS_LEASE_TIME = 51, /**< Request IP address lease time */ ESP_NETIF_IP_REQUEST_RETRY_TIME = 52, /**< Request IP address retry counter */ + ESP_NETIF_VENDOR_CLASS_IDENTIFIER = 60, /**< Vendor Class Identifier of a DHCP client */ + ESP_NETIF_VENDOR_SPECIFIC_INFO = 43, /**< Vendor Specific Information of a DHCP server */ } esp_netif_dhcp_option_id_t; /** IP event declarations */ diff --git a/tools/sdk/esp32c3/include/esp_phy/include/phy.h b/tools/sdk/esp32c3/include/esp_phy/include/phy.h index 1d0690f3562..e6aa21db50e 100644 --- a/tools/sdk/esp32c3/include/esp_phy/include/phy.h +++ b/tools/sdk/esp32c3/include/esp_phy/include/phy.h @@ -68,6 +68,13 @@ void phy_close_rf(void); void phy_xpd_tsens(void); #endif +#if CONFIG_IDF_TARGET_ESP32C3 +/** + * @brief Update internal state of PHY when wifi deinit powers off the wifi power domain. + */ +void phy_init_flag(void); +#endif + /** * @brief Store and load PHY digital registers. * diff --git a/tools/sdk/esp32c3/include/esp_timer/include/esp_timer.h b/tools/sdk/esp32c3/include/esp_timer/include/esp_timer.h index 8c942989477..eb4c6d707ab 100644 --- a/tools/sdk/esp32c3/include/esp_timer/include/esp_timer.h +++ b/tools/sdk/esp32c3/include/esp_timer/include/esp_timer.h @@ -1,16 +1,8 @@ -// Copyright 2017 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -83,11 +75,28 @@ typedef struct { bool skip_unhandled_events; //!< Skip unhandled events for periodic timers } esp_timer_create_args_t; + +/** + * @brief Minimal initialization of esp_timer + * + * @note This function is called from startup code. Applications do not need + * to call this function before using other esp_timer APIs. + * + * This function can be called very early in startup process, after this call + * only esp_timer_get_time function can be used. + * + * @return + * - ESP_OK on success + */ +esp_err_t esp_timer_early_init(void); + /** * @brief Initialize esp_timer library * * @note This function is called from startup code. Applications do not need * to call this function before using other esp_timer APIs. + * Before calling this function, esp_timer_early_init must be called by the + * startup code. * * @return * - ESP_OK on success diff --git a/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi_os_adapter.h b/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi_os_adapter.h index b583e916267..88d0ee54029 100644 --- a/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi_os_adapter.h +++ b/tools/sdk/esp32c3/include/esp_wifi/include/esp_private/wifi_os_adapter.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef ESP_WIFI_OS_ADAPTER_H_ #define ESP_WIFI_OS_ADAPTER_H_ diff --git a/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi.h b/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi.h index 51e03234841..2d671591765 100644 --- a/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi.h +++ b/tools/sdk/esp32c3/include/esp_wifi/include/esp_wifi.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /* Notes about WiFi Programming @@ -275,7 +267,7 @@ esp_err_t esp_wifi_deinit(void); * @brief Set the WiFi operating mode * * Set the WiFi operating mode as station, soft-AP or station+soft-AP, - * The default mode is soft-AP mode. + * The default mode is station mode. * * @param mode WiFi operating mode * diff --git a/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h b/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h index 675af141ebc..aa87e1b4db2 100644 --- a/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h +++ b/tools/sdk/esp32c3/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h @@ -166,10 +166,19 @@ #define configSTACK_OVERHEAD_APPTRACE 0 #endif +/* Stack watchpoint decreases minimum usable stack size by up to 60 bytes. + See FreeRTOS FREERTOS_WATCHPOINT_END_OF_STACK option in Kconfig. */ +#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK +#define configSTACK_OVERHEAD_WATCHPOINT 60 +#else +#define configSTACK_OVERHEAD_WATCHPOINT 0 +#endif + #define configSTACK_OVERHEAD_TOTAL ( \ configSTACK_OVERHEAD_CHECKER + \ configSTACK_OVERHEAD_OPTIMIZATION + \ - configSTACK_OVERHEAD_APPTRACE \ + configSTACK_OVERHEAD_APPTRACE + \ + configSTACK_OVERHEAD_WATCHPOINT \ ) #define configMINIMAL_STACK_SIZE (768 + configSTACK_OVERHEAD_TOTAL) diff --git a/tools/sdk/esp32c3/include/freertos/port/riscv/include/freertos/portmacro.h b/tools/sdk/esp32c3/include/freertos/port/riscv/include/freertos/portmacro.h index 8c09ba7df2f..e053e8219a5 100644 --- a/tools/sdk/esp32c3/include/freertos/port/riscv/include/freertos/portmacro.h +++ b/tools/sdk/esp32c3/include/freertos/port/riscv/include/freertos/portmacro.h @@ -139,18 +139,6 @@ BaseType_t xPortInIsrContext(void); */ BaseType_t xPortInterruptedFromISRContext(void); -/** - * @brief Disable interrupts in a nested manner - * - * - Cleaner solution allows nested interrupts disabling and restoring via local registers or stack. - * - They can be called from interrupts too. - * - WARNING Only applies to current CPU. - * - * @note [refactor-todo] Define this as portSET_INTERRUPT_MASK_FROM_ISR() instead - * @return unsigned Previous interrupt state - */ -static inline unsigned portENTER_CRITICAL_NESTED(void); - /* ---------------------- Spinlocks ------------------------ - Spinlocks added to match API with SMP FreeRTOS. Single core RISC-V does not need spin locks - Because single core does not have a primitive spinlock data type, we have to implement one here @@ -174,69 +162,19 @@ static inline unsigned portENTER_CRITICAL_NESTED(void); typedef struct { uint32_t owner; uint32_t count; -#ifdef CONFIG_FREERTOS_PORTMUX_DEBUG - const char *lastLockedFn; - int lastLockedLine; -#endif } portMUX_TYPE; /**< Spinlock initializer */ -#ifndef CONFIG_FREERTOS_PORTMUX_DEBUG -#define portMUX_INITIALIZER_UNLOCKED { \ +#define portMUX_INITIALIZER_UNLOCKED { \ .owner = portMUX_FREE_VAL, \ .count = 0, \ } -#else -#define portMUX_INITIALIZER_UNLOCKED { \ - .owner = portMUX_FREE_VAL, \ - .count = 0, \ - .lastLockedFn = "(never locked)", \ - .lastLockedLine = -1 \ - } -#endif /* CONFIG_FREERTOS_PORTMUX_DEBUG */ -#define portMUX_FREE_VAL SPINLOCK_FREE /**< Spinlock is free. [refactor-todo] check if this is still required */ -#define portMUX_NO_TIMEOUT SPINLOCK_WAIT_FOREVER /**< When passed for 'timeout_cycles', spin forever if necessary. [refactor-todo] check if this is still required */ -#define portMUX_TRY_LOCK SPINLOCK_NO_WAIT /**< Try to acquire the spinlock a single time only. [refactor-todo] check if this is still required */ - -/** - * @brief Initialize a spinlock - * - * - Initializes a spinlock that is used by FreeRTOS SMP critical sections - * - * @note [refactor-todo] We can make this inline or consider making it a macro - * @param[in] mux Spinlock - */ -void vPortCPUInitializeMutex(portMUX_TYPE *mux); - -/** - * @brief Acquire a spinlock - * - * @note [refactor-todo] check if we still need this - * @note [refactor-todo] Check if this should be inlined - * @param[in] mux Spinlock - */ -void vPortCPUAcquireMutex(portMUX_TYPE *mux); - -/** - * @brief Acquire a spinlock but with a specified timeout - * - * @note [refactor-todo] Check if we still need this - * @note [refactor-todo] Check if this should be inlined - * @note [refactor-todo] Check if this function should be renamed (due to bool return type) - * @param[in] mux Spinlock - * @param[in] timeout Timeout in number of CPU cycles - * @return true Spinlock acquired - * @return false Timed out - */ -bool vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout_cycles); - -/** - * @brief Release a spinlock - * - * @note [refactor-todo] check if we still need this - * @note [refactor-todo] Check if this should be inlined - * @param[in] mux Spinlock - */ -void vPortCPUReleaseMutex(portMUX_TYPE *mux); +#define portMUX_FREE_VAL SPINLOCK_FREE /**< Spinlock is free. [refactor-todo] check if this is still required */ +#define portMUX_NO_TIMEOUT SPINLOCK_WAIT_FOREVER /**< When passed for 'timeout_cycles', spin forever if necessary. [refactor-todo] check if this is still required */ +#define portMUX_TRY_LOCK SPINLOCK_NO_WAIT /**< Try to acquire the spinlock a single time only. [refactor-todo] check if this is still required */ +#define portMUX_INITIALIZE(mux) ({ \ + (mux)->owner = portMUX_FREE_VAL; \ + (mux)->count = 0; \ +}) /** * @brief Wrapper for atomic compare-and-set instruction @@ -403,19 +341,26 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void) // --------------------- Interrupts ------------------------ -#define portEXIT_CRITICAL_NESTED(state) do { portCLEAR_INTERRUPT_MASK_FROM_ISR(state);} while(0); #define portDISABLE_INTERRUPTS() portSET_INTERRUPT_MASK_FROM_ISR() #define portENABLE_INTERRUPTS() portCLEAR_INTERRUPT_MASK_FROM_ISR(1) #define portSET_INTERRUPT_MASK_FROM_ISR() vPortSetInterruptMask() -#define portCLEAR_INTERRUPT_MASK_FROM_ISR(uxSavedStatusValue) vPortClearInterruptMask(uxSavedStatusValue) +#define portCLEAR_INTERRUPT_MASK_FROM_ISR(uxSavedStatusValue) vPortClearInterruptMask(uxSavedStatusValue) // ------------------ Critical Sections -------------------- -#define portENTER_CRITICAL(mux) {(void)mux; vPortEnterCritical();} -#define portEXIT_CRITICAL(mux) {(void)mux; vPortExitCritical();} +#define portENTER_CRITICAL(mux) {(void)mux; vPortEnterCritical();} +#define portEXIT_CRITICAL(mux) {(void)mux; vPortExitCritical();} +#define portTRY_ENTER_CRITICAL(mux, timeout) ({ \ + (void)mux; (void)timeout; \ + vPortEnterCritical(); \ + BaseType_t ret = pdPASS; \ + ret; \ +}) //In single-core RISC-V, we can use the same critical section API -#define portENTER_CRITICAL_ISR(mux) portENTER_CRITICAL(mux) -#define portEXIT_CRITICAL_ISR(mux) portEXIT_CRITICAL(mux) +#define portENTER_CRITICAL_ISR(mux) portENTER_CRITICAL(mux) +#define portEXIT_CRITICAL_ISR(mux) portEXIT_CRITICAL(mux) +#define portTRY_ENTER_CRITICAL_ISR(mux, timeout) portTRY_ENTER_CRITICAL(mux, timeout) + /* [refactor-todo] on RISC-V, both ISR and non-ISR cases result in the same call. We can redefine this macro */ #define portENTER_CRITICAL_SAFE(mux) ({ \ if (xPortInIsrContext()) { \ @@ -431,6 +376,7 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void) portEXIT_CRITICAL(mux); \ } \ }) +#define portTRY_ENTER_CRITICAL_SAFE(mux, timeout) portENTER_CRITICAL_SAFE(mux, timeout) // ---------------------- Yielding ------------------------- @@ -472,11 +418,7 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void) // --------------------- Interrupts ------------------------ -static inline unsigned portENTER_CRITICAL_NESTED(void) -{ - unsigned state = portSET_INTERRUPT_MASK_FROM_ISR(); - return state; -} + // ---------------------- Spinlocks ------------------------ @@ -538,6 +480,14 @@ bool xPortcheckValidStackMem(const void *ptr); #define portVALID_TCB_MEM(ptr) xPortCheckValidTCBMem(ptr) #define portVALID_STACK_MEM(ptr) xPortcheckValidStackMem(ptr) + + +/* ---------------------------------------------------- Deprecate ------------------------------------------------------ + * - Pull in header containing deprecated macros here + * ------------------------------------------------------------------------------------------------------------------ */ + +#include "portmacro_deprecated.h" + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32c3/include/freertos/port/riscv/include/freertos/portmacro_deprecated.h b/tools/sdk/esp32c3/include/freertos/port/riscv/include/freertos/portmacro_deprecated.h new file mode 100644 index 00000000000..597d99c3330 --- /dev/null +++ b/tools/sdk/esp32c3/include/freertos/port/riscv/include/freertos/portmacro_deprecated.h @@ -0,0 +1,94 @@ +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* ---------------------------------------------------- Deprecate ------------------------------------------------------ + * - Macros or functions that should be deprecated in v5.0, then removed in the next major release + * - Kept as not to cause a breaking change + * - Include this header at the end of portmacro.h + * ------------------------------------------------------------------------------------------------------------------ */ + +/** + * @brief Disable interrupts in a nested manner + * + * Does the exact same thing as portSET_INTERRUPT_MASK_FROM_ISR() + * + * @deprecated This function is deprecated. Call portSET_INTERRUPT_MASK_FROM_ISR() instead + */ +static inline __attribute__((deprecated)) UBaseType_t portENTER_CRITICAL_NESTED(void) { + return portSET_INTERRUPT_MASK_FROM_ISR(); +} + +/** + * @brief Reenables interrupts in a nested manner + * + * Does the exact same thing as portCLEAR_INTERRUPT_MASK_FROM_ISR() + * + * @deprecated This function is deprecated. Call portCLEAR_INTERRUPT_MASK_FROM_ISR() instead + */ +static inline void __attribute__((deprecated)) portEXIT_CRITICAL_NESTED(UBaseType_t prev_level) +{ + portCLEAR_INTERRUPT_MASK_FROM_ISR(prev_level); +} + +/* ---------------------- Spinlocks --------------------- */ + +/** + * @brief Deprecated placed holder function to initialize a spinlock + * + * Currently does nothing. + * + * @deprecated This function is deprecated. If on multi-core, use spinlock_initialize() instead + * @param[in] mux Spinlock + */ +static inline void __attribute__((deprecated)) __attribute__((always_inline)) vPortCPUInitializeMutex(portMUX_TYPE *mux) +{ + (void)mux; +} + +/** + * @brief Deprecated placed holder function to acquire a spinlock + * + * Currently does nothing. + * + * @deprecated This function is deprecated. If on multi-core, use spinlock_acquire() instead + * @param[in] mux Spinlock + */ +static inline void __attribute__((deprecated)) __attribute__((always_inline)) vPortCPUAcquireMutex(portMUX_TYPE *mux) +{ + (void)mux; +} + +/** + * @brief Deprecated placed holder function to acquire a spinlock but with a specified timeout + * + * Currently just returns true + * + * @deprecated This function is deprecated. If on multi-core, use spinlock_acquire() instead + * @note Does not have deprecated attribute due to usage in app_trace_util.c + * @param[in] mux Spinlock + * @param[in] timeout Timeout in number of CPU cycles + * @return true Always returns true + */ +static inline bool __attribute__((always_inline)) vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout_cycles) +{ + (void)mux; + (void)timeout_cycles; + return true; +} + +/** + * @brief Deprecated placed holder function to release a spinlock + * + * Currently does nothing. + * + * @deprecated This function is deprecated. If on multi-core, use spinlock_release() instead + * @note Does not have deprecated attribute due to usage in app_trace_util.c + * @param[in] mux Spinlock + */ +static inline void __attribute__((always_inline)) vPortCPUReleaseMutex(portMUX_TYPE *mux) +{ + (void)mux; +} diff --git a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2s_ll.h b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2s_ll.h index 0cfb05a266a..f7cb496b4b8 100644 --- a/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2s_ll.h +++ b/tools/sdk/esp32c3/include/hal/esp32c3/include/hal/i2s_ll.h @@ -487,7 +487,7 @@ static inline void i2s_ll_rx_set_active_chan_mask(i2s_dev_t *hw, uint32_t chan_m * @param hw Peripheral I2S hardware instance address. * @param ws_pol_level pin level of WS(output) when receiving left channel data */ -static inline void i2s_tx_set_ws_idle_pol(i2s_dev_t *hw, int ws_pol_level) +static inline void i2s_ll_tx_set_ws_idle_pol(i2s_dev_t *hw, bool ws_pol_level) { hw->tx_conf.tx_ws_idle_pol = ws_pol_level; } @@ -498,7 +498,7 @@ static inline void i2s_tx_set_ws_idle_pol(i2s_dev_t *hw, int ws_pol_level) * @param hw Peripheral I2S hardware instance address. * @param ws_pol_level pin level of WS(input) when receiving left channel data */ -static inline void i2s_rx_set_ws_idle_pol(i2s_dev_t *hw, int ws_pol_level) +static inline void i2s_ll_rx_set_ws_idle_pol(i2s_dev_t *hw, bool ws_pol_level) { hw->rx_conf.rx_ws_idle_pol = ws_pol_level; } diff --git a/tools/sdk/esp32c3/include/hal/include/hal/lcd_types.h b/tools/sdk/esp32c3/include/hal/include/hal/lcd_types.h index 01e6d0c2949..1a62d8f8eb4 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/lcd_types.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/lcd_types.h @@ -13,12 +13,17 @@ extern "C" { /** * @brief LCD clock source * @note User should select the clock source based on the real requirement: - * - * | LCD clock source | Features | Power Management | - * |---------------------|--------------------------|----------------------------| - * | LCD_CLK_SRC_PLL160M | High resolution, fixed | ESP_PM_APB_FREQ_MAX lock | - * | LCD_CLK_SRC_APLL | Configurable resolution | ESP_PM_NO_LIGHT_SLEEP lock | - * | LCD_CLK_SRC_XTAL | Medium resolution, fixed | No PM lock | + * @verbatim embed:rst:leading-asterisk + * +---------------------+-------------------------+----------------------------+ + * | LCD clock source | Features | Power Management | + * +=====================+=========================+============================+ + * | LCD_CLK_SRC_PLL160M | High resolution | ESP_PM_APB_FREQ_MAX lock | + * +---------------------+-------------------------+----------------------------+ + * | LCD_CLK_SRC_APLL | Configurable resolution | ESP_PM_NO_LIGHT_SLEEP lock | + * +---------------------+-------------------------+----------------------------+ + * | LCD_CLK_SRC_XTAL | Medium resolution | No PM lock | + * +---------------------+-------------------------+----------------------------+ + * @endverbatim */ typedef enum { LCD_CLK_SRC_PLL160M, /*!< Select PLL160M as the source clock */ diff --git a/tools/sdk/esp32c3/include/hal/include/hal/usbh_hal.h b/tools/sdk/esp32c3/include/hal/include/hal/usbh_hal.h index b315f6c0b14..6360f7b3f36 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/usbh_hal.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/usbh_hal.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -50,17 +42,6 @@ typedef struct { uint32_t ptx_fifo_lines; /**< Size of the Periodic FIFO in terms the number of FIFO lines */ } usbh_hal_fifo_config_t; -// --------------------- HAL States ------------------------ - -/** - * @brief Channel states - */ -typedef enum { - USBH_HAL_CHAN_STATE_HALTED = 0, /**< The channel is halted. No transfer descriptor list is being executed */ - USBH_HAL_CHAN_STATE_ACTIVE, /**< The channel is active. A transfer descriptor list is being executed */ - USBH_HAL_CHAN_STATE_ERROR, /**< The channel is in the error state */ -} usbh_hal_chan_state_t; - // --------------------- HAL Events ------------------------ /** @@ -153,8 +134,7 @@ typedef struct { struct { uint32_t active: 1; /**< Debugging bit to indicate whether channel is enabled */ uint32_t halt_requested: 1; /**< A halt has been requested */ - uint32_t error_pending: 1; /**< The channel is waiting for the error to be handled */ - uint32_t reserved: 1; + uint32_t reserved: 2; uint32_t chan_idx: 4; /**< The index number of the channel */ uint32_t reserved24: 24; }; @@ -556,23 +536,6 @@ static inline void *usbh_hal_chan_get_context(usbh_hal_chan_t *chan_obj) return chan_obj->chan_ctx; } -/** - * @brief Get the current state of a channel - * - * @param chan_obj Channel object - * @return usbh_hal_chan_state_t State of the channel - */ -static inline usbh_hal_chan_state_t usbh_hal_chan_get_state(usbh_hal_chan_t *chan_obj) -{ - if (chan_obj->flags.error_pending) { - return USBH_HAL_CHAN_STATE_ERROR; - } else if (chan_obj->flags.active) { - return USBH_HAL_CHAN_STATE_ACTIVE; - } else { - return USBH_HAL_CHAN_STATE_HALTED; - } -} - /** * @brief Set the endpoint information for a particular channel * @@ -602,7 +565,7 @@ void usbh_hal_chan_set_ep_char(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_ob static inline void usbh_hal_chan_set_dir(usbh_hal_chan_t *chan_obj, bool is_in) { //Cannot change direction whilst channel is still active or in error - HAL_ASSERT(!chan_obj->flags.active && !chan_obj->flags.error_pending); + HAL_ASSERT(!chan_obj->flags.active); usbh_ll_chan_set_dir(chan_obj->regs, is_in); } @@ -621,7 +584,7 @@ static inline void usbh_hal_chan_set_dir(usbh_hal_chan_t *chan_obj, bool is_in) static inline void usbh_hal_chan_set_pid(usbh_hal_chan_t *chan_obj, int pid) { //Cannot change pid whilst channel is still active or in error - HAL_ASSERT(!chan_obj->flags.active && !chan_obj->flags.error_pending); + HAL_ASSERT(!chan_obj->flags.active); //Update channel object and set the register usbh_ll_chan_set_pid(chan_obj->regs, pid); } @@ -638,7 +601,7 @@ static inline void usbh_hal_chan_set_pid(usbh_hal_chan_t *chan_obj, int pid) */ static inline uint32_t usbh_hal_chan_get_pid(usbh_hal_chan_t *chan_obj) { - HAL_ASSERT(!chan_obj->flags.active && !chan_obj->flags.error_pending); + HAL_ASSERT(!chan_obj->flags.active); return usbh_ll_chan_get_pid(chan_obj->regs); } @@ -688,27 +651,33 @@ static inline int usbh_hal_chan_get_qtd_idx(usbh_hal_chan_t *chan_obj) bool usbh_hal_chan_request_halt(usbh_hal_chan_t *chan_obj); /** - * @brief Get a channel's error + * @brief Indicate that a channel is halted after a port error + * + * When a port error occurs (e.g., discconect, overcurrent): + * - Any previously active channels will remain active (i.e., they will not receive a channel interrupt) + * - Attempting to disable them using usbh_hal_chan_request_halt() will NOT generate an interrupt for ISOC channels + * (probalby something to do with the periodic scheduling) + * + * However, the channel's enable bit can be left as 1 since after a port error, a soft reset will be done anyways. + * This function simply updates the channels internal state variable to indicate it is halted (thus allowing it to be + * freed). * * @param chan_obj Channel object - * @return usbh_hal_chan_error_t The type of error the channel has encountered */ -static inline usbh_hal_chan_error_t usbh_hal_chan_get_error(usbh_hal_chan_t *chan_obj) +static inline void usbh_hal_chan_mark_halted(usbh_hal_chan_t *chan_obj) { - HAL_ASSERT(chan_obj->flags.error_pending); - return chan_obj->error; + chan_obj->flags.active = 0; } /** - * @brief Clear a channel of it's error + * @brief Get a channel's error * * @param chan_obj Channel object + * @return usbh_hal_chan_error_t The type of error the channel has encountered */ -static inline void usbh_hal_chan_clear_error(usbh_hal_chan_t *chan_obj) +static inline usbh_hal_chan_error_t usbh_hal_chan_get_error(usbh_hal_chan_t *chan_obj) { - //Can only clear error when an error has occurred - HAL_ASSERT(chan_obj->flags.error_pending); - chan_obj->flags.error_pending = 0; + return chan_obj->error; } // -------------------------------------------- Transfer Descriptor List ----------------------------------------------- diff --git a/tools/sdk/esp32c3/include/hal/include/hal/usbh_ll.h b/tools/sdk/esp32c3/include/hal/include/hal/usbh_ll.h index a6c03e302a4..63f7b8219d1 100644 --- a/tools/sdk/esp32c3/include/hal/include/hal/usbh_ll.h +++ b/tools/sdk/esp32c3/include/hal/include/hal/usbh_ll.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -23,6 +15,8 @@ extern "C" { #include "soc/usbh_struct.h" #include "soc/usb_wrap_struct.h" #include "hal/usb_types_private.h" +#include "hal/misc.h" + /* ----------------------------------------------------------------------------- ------------------------------- Global Registers ------------------------------- @@ -328,7 +322,7 @@ static inline void usb_ll_dis_intrs(usbh_dev_t *hw, uint32_t intr_mask) static inline void usb_ll_set_rx_fifo_size(usbh_dev_t *hw, uint32_t num_lines) { //Set size in words - hw->grxfsiz_reg.rxfdep = num_lines; + HAL_FORCE_MODIFY_U32_REG_FIELD(hw->grxfsiz_reg, rxfdep, num_lines); } // -------------------------- GNPTXFSIZ Register ------------------------------- @@ -337,8 +331,8 @@ static inline void usb_ll_set_nptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint { usb_gnptxfsiz_reg_t gnptxfsiz; gnptxfsiz.val = hw->gnptxfsiz_reg.val; - gnptxfsiz.nptxfstaddr = addr; - gnptxfsiz.nptxfdep = num_lines; + HAL_FORCE_MODIFY_U32_REG_FIELD(gnptxfsiz, nptxfstaddr, addr); + HAL_FORCE_MODIFY_U32_REG_FIELD(gnptxfsiz, nptxfdep, num_lines); hw->gnptxfsiz_reg.val = gnptxfsiz.val; } @@ -373,8 +367,8 @@ static inline void usbh_ll_set_ptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint { usb_hptxfsiz_reg_t hptxfsiz; hptxfsiz.val = hw->hptxfsiz_reg.val; - hptxfsiz.ptxfstaddr = addr; - hptxfsiz.ptxfsize = num_lines; + HAL_FORCE_MODIFY_U32_REG_FIELD(hptxfsiz, ptxfstaddr, addr); + HAL_FORCE_MODIFY_U32_REG_FIELD(hptxfsiz, ptxfsize, num_lines); hw->hptxfsiz_reg.val = hptxfsiz.val; } @@ -473,7 +467,7 @@ static inline void usbh_ll_hfir_set_defaults(usbh_dev_t *hw, usb_priv_speed_t sp static inline uint32_t usbh_ll_get_frm_time_rem(usbh_dev_t *hw) { - return hw->hfnum_reg.frrem; + return HAL_FORCE_READ_U32_REG_FIELD(hw->hfnum_reg, frrem); } static inline uint32_t usbh_ll_get_frm_num(usbh_dev_t *hw) @@ -485,7 +479,7 @@ static inline uint32_t usbh_ll_get_frm_num(usbh_dev_t *hw) static inline uint32_t usbh_ll_get_p_tx_queue_top(usbh_dev_t *hw) { - return hw->hptxsts_reg.ptxqtop; + return HAL_FORCE_READ_U32_REG_FIELD(hw->hptxsts_reg, ptxqtop); } static inline uint32_t usbh_ll_get_p_tx_queue_space_avail(usbh_dev_t *hw) @@ -495,20 +489,21 @@ static inline uint32_t usbh_ll_get_p_tx_queue_space_avail(usbh_dev_t *hw) static inline uint32_t usbh_ll_get_p_tx_fifo_space_avail(usbh_dev_t *hw) { - return hw->hptxsts_reg.ptxfspcavail; + return HAL_FORCE_READ_U32_REG_FIELD(hw->hptxsts_reg, ptxfspcavail); } // ----------------------------- HAINT Register -------------------------------- static inline uint32_t usbh_ll_get_chan_intrs_msk(usbh_dev_t *hw) { - return hw->haint_reg.haint; + return HAL_FORCE_READ_U32_REG_FIELD(hw->haint_reg, haint); } // --------------------------- HAINTMSK Register ------------------------------- static inline void usbh_ll_haintmsk_en_chan_intr(usbh_dev_t *hw, uint32_t mask) { + hw->haintmsk_reg.val |= mask; } @@ -817,31 +812,6 @@ static inline void usbh_ll_chan_set_dma_addr_non_iso(volatile usb_host_chan_regs chan->hcdma_reg.non_iso.ctd = qtd_idx; } -static inline void usbh_ll_chan_set_dma_addr_iso(volatile usb_host_chan_regs_t *chan, - void *dmaaddr, - uint32_t ntd) -{ - int n; - if (ntd == 2) { - n = 4; - } else if (ntd == 4) { - n = 5; - } else if (ntd == 8) { - n = 6; - } else if (ntd == 16) { - n = 7; - } else if (ntd == 32) { - n = 8; - } else { //ntd == 64 - n = 9; - } - //Set HCTSIZi - chan->hctsiz_reg.ntd = ntd -1; - chan->hctsiz_reg.sched_info = 0xFF; //Always set to 0xFF for FS - //Set HCDMAi - chan->hcdma_reg.iso.dmaaddr_ctd = (((uint32_t)dmaaddr) & 0x1FF) << (n-3); //ctd is set to 0 -} - static inline int usbh_ll_chan_get_ctd(usb_host_chan_regs_t *chan) { return chan->hcdma_reg.non_iso.ctd; @@ -850,12 +820,12 @@ static inline int usbh_ll_chan_get_ctd(usb_host_chan_regs_t *chan) static inline void usbh_ll_chan_hctsiz_init(volatile usb_host_chan_regs_t *chan) { chan->hctsiz_reg.dopng = 0; //Don't do ping - chan->hctsiz_reg.sched_info = 0xFF; //Schedinfo is always 0xFF for fullspeed. Not used in Bulk/Ctrl channels + HAL_FORCE_MODIFY_U32_REG_FIELD(chan->hctsiz_reg, sched_info, 0xFF); //Schedinfo is always 0xFF for fullspeed. Not used in Bulk/Ctrl channels } static inline void usbh_ll_chan_set_qtd_list_len(volatile usb_host_chan_regs_t *chan, int qtd_list_len) { - chan->hctsiz_reg.ntd = qtd_list_len - 1; //Set the length of the descriptor list + HAL_FORCE_MODIFY_U32_REG_FIELD(chan->hctsiz_reg, ntd, qtd_list_len - 1); //Set the length of the descriptor list } // ---------------------------- HCDMABi Register ------------------------------- diff --git a/tools/sdk/esp32c3/include/idf_test/include/esp32s2/idf_performance_target.h b/tools/sdk/esp32c3/include/idf_test/include/esp32s2/idf_performance_target.h index f37c2a9e00f..dc8a060f54b 100644 --- a/tools/sdk/esp32c3/include/idf_test/include/esp32s2/idf_performance_target.h +++ b/tools/sdk/esp32c3/include/idf_test/include/esp32s2/idf_performance_target.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/idf_test/include/esp32s3/idf_performance_target.h b/tools/sdk/esp32c3/include/idf_test/include/esp32s3/idf_performance_target.h index 62f996fc658..b744cda8fa0 100644 --- a/tools/sdk/esp32c3/include/idf_test/include/esp32s3/idf_performance_target.h +++ b/tools/sdk/esp32c3/include/idf_test/include/esp32s3/idf_performance_target.h @@ -1,23 +1,15 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #define IDF_PERFORMANCE_MIN_AES_CBC_THROUGHPUT_MBSEC 43 // SHA256 hardware throughput at 240MHz, threshold set lower than worst case -#define IDF_PERFORMANCE_MIN_SHA256_THROUGHPUT_MBSEC 19.8 +#define IDF_PERFORMANCE_MIN_SHA256_THROUGHPUT_MBSEC 90 // esp_sha() time to process 32KB of input data from RAM #define IDF_PERFORMANCE_MAX_TIME_SHA1_32KB 1000 #define IDF_PERFORMANCE_MAX_TIME_SHA512_32KB 900 diff --git a/tools/sdk/esp32c3/include/idf_test/include/idf_performance.h b/tools/sdk/esp32c3/include/idf_test/include/idf_performance.h index 9d99070b953..b558feb4ca3 100644 --- a/tools/sdk/esp32c3/include/idf_test/include/idf_performance.h +++ b/tools/sdk/esp32c3/include/idf_test/include/idf_performance.h @@ -8,7 +8,7 @@ */ #ifndef IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP -#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 200 +#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 250 #endif #ifndef IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM #define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM 300 diff --git a/tools/sdk/esp32c3/include/lwip/port/esp32/include/lwipopts.h b/tools/sdk/esp32c3/include/lwip/port/esp32/include/lwipopts.h index b9cfe17aca9..47215e99dae 100644 --- a/tools/sdk/esp32c3/include/lwip/port/esp32/include/lwipopts.h +++ b/tools/sdk/esp32c3/include/lwip/port/esp32/include/lwipopts.h @@ -1,34 +1,11 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. + * SPDX-FileCopyrightText: 2001-2003 Swedish Institute of Computer Science * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Simon Goldschmidt + * SPDX-License-Identifier: BSD-3-Clause * + * SPDX-FileContributor: 2015-2021 Espressif Systems (Shanghai) CO LTD */ + #ifndef __LWIPOPTS_H__ #define __LWIPOPTS_H__ @@ -272,6 +249,11 @@ */ #define DHCP_OPTIONS_LEN CONFIG_LWIP_DHCP_OPTIONS_LEN +/** + * LWIP_DHCP_DISABLE_VENDOR_CLASS_ID==1: Do not add option 60 (Vendor Class Identifier) to DHCP packets + */ +#define ESP_DHCP_DISABLE_VENDOR_CLASS_IDENTIFIER CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID + /* ------------------------------------ ---------- AUTOIP options ---------- diff --git a/tools/sdk/esp32c3/include/mbedtls/port/include/mbedtls/bignum.h b/tools/sdk/esp32c3/include/mbedtls/port/include/mbedtls/bignum.h index a317c456060..4f84bed7407 100644 --- a/tools/sdk/esp32c3/include/mbedtls/port/include/mbedtls/bignum.h +++ b/tools/sdk/esp32c3/include/mbedtls/port/include/mbedtls/bignum.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include_next "mbedtls/bignum.h" @@ -77,4 +69,31 @@ void esp_mpi_release_hardware(void); */ int esp_mpi_mul_mpi_mod(mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M); +#if CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI + +/** + * @brief Perform a sliding-window exponentiation: X = A^E mod N + * + * @param X The destination MPI. This must point to an initialized MPI. + * @param A The base of the exponentiation. + * This must point to an initialized MPI. + * @param E The exponent MPI. This must point to an initialized MPI. + * @param N The base for the modular reduction. This must point to an + * initialized MPI. + * @param _RR A helper MPI depending solely on \p N which can be used to + * speed-up multiple modular exponentiations for the same value + * of \p N. This may be \c NULL. If it is not \c NULL, it must + * point to an initialized MPI. + * + * @return \c 0 if successful. + * @return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. + * @return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \c N is negative or + * even, or if \c E is negative. + * @return Another negative error code on different kinds of failures. + * + */ +int mbedtls_mpi_exp_mod_soft(mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *E, const mbedtls_mpi *N, mbedtls_mpi *_RR); + +#endif // CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI + #endif // CONFIG_MBEDTLS_HARDWARE_MPI diff --git a/tools/sdk/esp32c3/include/mbedtls/port/include/mbedtls/esp_config.h b/tools/sdk/esp32c3/include/mbedtls/port/include/mbedtls/esp_config.h index f36ebf9bc75..9c63118eb57 100644 --- a/tools/sdk/esp32c3/include/mbedtls/port/include/mbedtls/esp_config.h +++ b/tools/sdk/esp32c3/include/mbedtls/port/include/mbedtls/esp_config.h @@ -153,15 +153,22 @@ #undef MBEDTLS_MD5_ALT #endif -/* The following MPI (bignum) functions have ESP32 hardware support. - For exponential mod, both software and hardware implementation - will be compiled. If CONFIG_MBEDTLS_HARDWARE_MPI is enabled, mod APIs - will be wrapped to use hardware implementation. -*/ -#undef MBEDTLS_MPI_EXP_MOD_ALT +/* The following MPI (bignum) functions have hardware support. + * Uncommenting these macros will use the hardware-accelerated + * implementations. + */ #ifdef CONFIG_MBEDTLS_HARDWARE_MPI +#ifdef CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI + /* Prefer hardware and fallback to software */ + #define MBEDTLS_MPI_EXP_MOD_ALT_FALLBACK +#else + /* Hardware only mode */ + #define MBEDTLS_MPI_EXP_MOD_ALT +#endif #define MBEDTLS_MPI_MUL_MPI_ALT #else +#undef MBEDTLS_MPI_EXP_MOD_ALT_FALLBACK +#undef MBEDTLS_MPI_EXP_MOD_ALT #undef MBEDTLS_MPI_MUL_MPI_ALT #endif diff --git a/tools/sdk/esp32c3/include/sdmmc/include/sdmmc_cmd.h b/tools/sdk/esp32c3/include/sdmmc/include/sdmmc_cmd.h index 6e2f98d90d6..e0e7162391b 100644 --- a/tools/sdk/esp32c3/include/sdmmc/include/sdmmc_cmd.h +++ b/tools/sdk/esp32c3/include/sdmmc/include/sdmmc_cmd.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -45,6 +37,17 @@ esp_err_t sdmmc_card_init(const sdmmc_host_t* host, */ void sdmmc_card_print_info(FILE* stream, const sdmmc_card_t* card); +/** + * Get status of SD/MMC card + * + * @param card pointer to card information structure previously initialized + * using sdmmc_card_init + * @return + * - ESP_OK on success + * - One of the error codes from SDMMC host controller + */ +esp_err_t sdmmc_get_status(sdmmc_card_t* card); + /** * Write given number of sectors to SD/MMC card * diff --git a/tools/sdk/esp32c3/include/vfs/include/esp_vfs.h b/tools/sdk/esp32c3/include/vfs/include/esp_vfs.h index 7ba63645301..0498a3aa59b 100644 --- a/tools/sdk/esp32c3/include/vfs/include/esp_vfs.h +++ b/tools/sdk/esp32c3/include/vfs/include/esp_vfs.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __ESP_VFS_H__ #define __ESP_VFS_H__ @@ -254,7 +246,6 @@ typedef struct #endif // CONFIG_VFS_SUPPORT_SELECT } esp_vfs_t; - /** * Register a virtual filesystem for given path prefix. * @@ -411,7 +402,8 @@ int esp_vfs_utime(const char *path, const struct utimbuf *times); * @param timeout If not NULL, then points to timeval structure which * specifies the time period after which the functions should * time-out and return. If it is NULL, then the function will - * not time-out. + * not time-out. Note that the timeout period is rounded up to + * the system tick and incremented by one. * * @return The number of descriptors set in the descriptor sets, or -1 * when an error (specified by errno) have occurred. diff --git a/tools/sdk/esp32c3/include/vfs/include/esp_vfs_cdcacm.h b/tools/sdk/esp32c3/include/vfs/include/esp_vfs_cdcacm.h index b8dd03d92aa..416efb35a4e 100644 --- a/tools/sdk/esp32c3/include/vfs/include/esp_vfs_cdcacm.h +++ b/tools/sdk/esp32c3/include/vfs/include/esp_vfs_cdcacm.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/vfs/include/esp_vfs_console.h b/tools/sdk/esp32c3/include/vfs/include/esp_vfs_console.h new file mode 100644 index 00000000000..bc5ce6733dd --- /dev/null +++ b/tools/sdk/esp32c3/include/vfs/include/esp_vfs_console.h @@ -0,0 +1,24 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief add uart/usb_serial_jtag/usb_otg_acmcdc virtual filesystem driver + * + * This function is called from startup code to enable serial output + */ +esp_err_t esp_vfs_console_register(void); + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32c3/include/vfs/include/esp_vfs_dev.h b/tools/sdk/esp32c3/include/vfs/include/esp_vfs_dev.h index dc33fe746dc..91e9374972e 100644 --- a/tools/sdk/esp32c3/include/vfs/include/esp_vfs_dev.h +++ b/tools/sdk/esp32c3/include/vfs/include/esp_vfs_dev.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/include/vfs/include/esp_vfs_usb_serial_jtag.h b/tools/sdk/esp32c3/include/vfs/include/esp_vfs_usb_serial_jtag.h index 54ff1f4e444..c53a671be89 100644 --- a/tools/sdk/esp32c3/include/vfs/include/esp_vfs_usb_serial_jtag.h +++ b/tools/sdk/esp32c3/include/vfs/include/esp_vfs_usb_serial_jtag.h @@ -1,16 +1,8 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32c3/ld/libbtbb.a b/tools/sdk/esp32c3/ld/libbtbb.a index 4092c15a03e..8d30c9c167c 100644 Binary files a/tools/sdk/esp32c3/ld/libbtbb.a and b/tools/sdk/esp32c3/ld/libbtbb.a differ diff --git a/tools/sdk/esp32c3/ld/libcat_face_detect.a b/tools/sdk/esp32c3/ld/libcat_face_detect.a index 863bfe33d24..92ffea09ff7 100644 Binary files a/tools/sdk/esp32c3/ld/libcat_face_detect.a and b/tools/sdk/esp32c3/ld/libcat_face_detect.a differ diff --git a/tools/sdk/esp32c3/ld/libcolor_detect.a b/tools/sdk/esp32c3/ld/libcolor_detect.a index 003fa239d6b..e073722fb38 100644 Binary files a/tools/sdk/esp32c3/ld/libcolor_detect.a and b/tools/sdk/esp32c3/ld/libcolor_detect.a differ diff --git a/tools/sdk/esp32c3/ld/libdl.a b/tools/sdk/esp32c3/ld/libdl.a index 338f67096a2..76e1b7c50bc 100644 Binary files a/tools/sdk/esp32c3/ld/libdl.a and b/tools/sdk/esp32c3/ld/libdl.a differ diff --git a/tools/sdk/esp32c3/ld/libhuman_face_detect.a b/tools/sdk/esp32c3/ld/libhuman_face_detect.a index 10e66b66293..d91b25cc251 100644 Binary files a/tools/sdk/esp32c3/ld/libhuman_face_detect.a and b/tools/sdk/esp32c3/ld/libhuman_face_detect.a differ diff --git a/tools/sdk/esp32c3/ld/libmfn.a b/tools/sdk/esp32c3/ld/libmfn.a index 6c7b7179470..a1d56e467c8 100644 Binary files a/tools/sdk/esp32c3/ld/libmfn.a and b/tools/sdk/esp32c3/ld/libmfn.a differ diff --git a/tools/sdk/esp32c3/ld/libphy.a b/tools/sdk/esp32c3/ld/libphy.a index f19a1449135..7f13bfbe5ed 100644 Binary files a/tools/sdk/esp32c3/ld/libphy.a and b/tools/sdk/esp32c3/ld/libphy.a differ diff --git a/tools/sdk/esp32c3/ld/sections.ld b/tools/sdk/esp32c3/ld/sections.ld index 76fa552c0d6..2925ee3ad56 100644 --- a/tools/sdk/esp32c3/ld/sections.ld +++ b/tools/sdk/esp32c3/ld/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32c3/sections.ld.in */ +/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32c3/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -163,8 +163,8 @@ SECTIONS *libesp_system.a:esp_system.*(.literal.esp_system_abort .text.esp_system_abort) *libesp_system.a:ubsan.*(.literal .literal.* .text .text.*) *libfreertos.a:(EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .literal EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .literal.* EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .text EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .text.*) - *libfreertos.a:port.*(.text .text.prvTaskExitError .text.pxPortInitialiseStack .text.unlikely.vPortEndScheduler .text.vApplicationStackOverflowHook .text.vPortCPUAcquireMutex .text.vPortCPUAcquireMutexTimeout .text.vPortCPUInitializeMutex .text.vPortCPUReleaseMutex .text.vPortClearInterruptMask .text.vPortEnterCritical .text.vPortExitCritical .text.vPortSetInterruptMask .text.vPortSetStackWatchpoint .text.vPortYield .text.vPortYieldFromISR .text.vPortYieldOtherCore .text.xPortGetTickRateHz .text.xPortInIsrContext .text.xPortStartScheduler) - *libfreertos.a:port_common.*(.text .text.esp_startup_start_app_common .text.xPortCheckValidTCBMem .text.xPortcheckValidStackMem) + *libfreertos.a:port.*(.text .text.prvTaskExitError .text.pxPortInitialiseStack .text.unlikely.vPortEndScheduler .text.vApplicationStackOverflowHook .text.vPortClearInterruptMask .text.vPortEnterCritical .text.vPortExitCritical .text.vPortSetInterruptMask .text.vPortSetStackWatchpoint .text.vPortYield .text.vPortYieldFromISR .text.vPortYieldOtherCore .text.xPortGetTickRateHz .text.xPortInIsrContext .text.xPortStartScheduler) + *libfreertos.a:port_common.*(.text .text.esp_startup_start_app_common .text.vApplicationGetIdleTaskMemory .text.vApplicationGetTimerTaskMemory .text.xPortCheckValidTCBMem .text.xPortcheckValidStackMem) *libgcc.a:_divsf3.*(.literal .literal.* .text .text.*) *libgcc.a:lib2funcs.*(.literal .literal.* .text .text.*) *libgcc.a:save-restore.*(.literal .literal.* .text .text.*) diff --git a/tools/sdk/esp32c3/lib/libapp_trace.a b/tools/sdk/esp32c3/lib/libapp_trace.a index 91d680093e9..79a3016141f 100644 Binary files a/tools/sdk/esp32c3/lib/libapp_trace.a and b/tools/sdk/esp32c3/lib/libapp_trace.a differ diff --git a/tools/sdk/esp32c3/lib/libapp_update.a b/tools/sdk/esp32c3/lib/libapp_update.a index 93cb95844eb..430c3644268 100644 Binary files a/tools/sdk/esp32c3/lib/libapp_update.a and b/tools/sdk/esp32c3/lib/libapp_update.a differ diff --git a/tools/sdk/esp32c3/lib/libasio.a b/tools/sdk/esp32c3/lib/libasio.a index 9c024e2b47c..cafe995246c 100644 Binary files a/tools/sdk/esp32c3/lib/libasio.a and b/tools/sdk/esp32c3/lib/libasio.a differ diff --git a/tools/sdk/esp32c3/lib/libbootloader_support.a b/tools/sdk/esp32c3/lib/libbootloader_support.a index a0590da52e9..5117293f635 100644 Binary files a/tools/sdk/esp32c3/lib/libbootloader_support.a and b/tools/sdk/esp32c3/lib/libbootloader_support.a differ diff --git a/tools/sdk/esp32c3/lib/libbt.a b/tools/sdk/esp32c3/lib/libbt.a index 66e735b52df..5e2ec2cddad 100644 Binary files a/tools/sdk/esp32c3/lib/libbt.a and b/tools/sdk/esp32c3/lib/libbt.a differ diff --git a/tools/sdk/esp32c3/lib/libcbor.a b/tools/sdk/esp32c3/lib/libcbor.a index e7c434c2a81..76aca1995bb 100644 Binary files a/tools/sdk/esp32c3/lib/libcbor.a and b/tools/sdk/esp32c3/lib/libcbor.a differ diff --git a/tools/sdk/esp32c3/lib/libcmock.a b/tools/sdk/esp32c3/lib/libcmock.a index 1233d25efc6..31972dee124 100644 Binary files a/tools/sdk/esp32c3/lib/libcmock.a and b/tools/sdk/esp32c3/lib/libcmock.a differ diff --git a/tools/sdk/esp32c3/lib/libcoap.a b/tools/sdk/esp32c3/lib/libcoap.a index a2a91353bfa..53bbbc81223 100644 Binary files a/tools/sdk/esp32c3/lib/libcoap.a and b/tools/sdk/esp32c3/lib/libcoap.a differ diff --git a/tools/sdk/esp32c3/lib/libcoexist.a b/tools/sdk/esp32c3/lib/libcoexist.a index 3b59719a8d4..1f7b6cc839b 100644 Binary files a/tools/sdk/esp32c3/lib/libcoexist.a and b/tools/sdk/esp32c3/lib/libcoexist.a differ diff --git a/tools/sdk/esp32c3/lib/libconsole.a b/tools/sdk/esp32c3/lib/libconsole.a index a652b80aa59..280fc8507ba 100644 Binary files a/tools/sdk/esp32c3/lib/libconsole.a and b/tools/sdk/esp32c3/lib/libconsole.a differ diff --git a/tools/sdk/esp32c3/lib/libcore.a b/tools/sdk/esp32c3/lib/libcore.a index a5cd3ef5edc..e9412d3973d 100644 Binary files a/tools/sdk/esp32c3/lib/libcore.a and b/tools/sdk/esp32c3/lib/libcore.a differ diff --git a/tools/sdk/esp32c3/lib/libcxx.a b/tools/sdk/esp32c3/lib/libcxx.a index fb11ac5e0b9..fc3ff2e4887 100644 Binary files a/tools/sdk/esp32c3/lib/libcxx.a and b/tools/sdk/esp32c3/lib/libcxx.a differ diff --git a/tools/sdk/esp32c3/lib/libdriver.a b/tools/sdk/esp32c3/lib/libdriver.a index 60acf52d230..75d49766f3d 100644 Binary files a/tools/sdk/esp32c3/lib/libdriver.a and b/tools/sdk/esp32c3/lib/libdriver.a differ diff --git a/tools/sdk/esp32c3/lib/libefuse.a b/tools/sdk/esp32c3/lib/libefuse.a index 350c681c786..b27dcefe316 100644 Binary files a/tools/sdk/esp32c3/lib/libefuse.a and b/tools/sdk/esp32c3/lib/libefuse.a differ diff --git a/tools/sdk/esp32c3/lib/libesp-tls.a b/tools/sdk/esp32c3/lib/libesp-tls.a index 7fe53ef76f0..67d44ecb154 100644 Binary files a/tools/sdk/esp32c3/lib/libesp-tls.a and b/tools/sdk/esp32c3/lib/libesp-tls.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_adc_cal.a b/tools/sdk/esp32c3/lib/libesp_adc_cal.a index cf457a4ea54..2d04ed5e137 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_adc_cal.a and b/tools/sdk/esp32c3/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_common.a b/tools/sdk/esp32c3/lib/libesp_common.a index bca5a667124..fff75528f5f 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_common.a and b/tools/sdk/esp32c3/lib/libesp_common.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_eth.a b/tools/sdk/esp32c3/lib/libesp_eth.a index bf6545b5232..c8e5e70adf1 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_eth.a and b/tools/sdk/esp32c3/lib/libesp_eth.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_event.a b/tools/sdk/esp32c3/lib/libesp_event.a index 1be265da740..4e4c5a28cfc 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_event.a and b/tools/sdk/esp32c3/lib/libesp_event.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_gdbstub.a b/tools/sdk/esp32c3/lib/libesp_gdbstub.a index 8836bbb6274..7788ebb573f 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_gdbstub.a and b/tools/sdk/esp32c3/lib/libesp_gdbstub.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_hid.a b/tools/sdk/esp32c3/lib/libesp_hid.a index 2b5f3c37a8c..56a41c5b6ff 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_hid.a and b/tools/sdk/esp32c3/lib/libesp_hid.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_http_client.a b/tools/sdk/esp32c3/lib/libesp_http_client.a index aaf720b7aa5..8d2400f530c 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_http_client.a and b/tools/sdk/esp32c3/lib/libesp_http_client.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_http_server.a b/tools/sdk/esp32c3/lib/libesp_http_server.a index 87b40880d62..011b4f5877a 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_http_server.a and b/tools/sdk/esp32c3/lib/libesp_http_server.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_https_ota.a b/tools/sdk/esp32c3/lib/libesp_https_ota.a index 6561ba652e3..acac370de74 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_https_ota.a and b/tools/sdk/esp32c3/lib/libesp_https_ota.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_https_server.a b/tools/sdk/esp32c3/lib/libesp_https_server.a index 7fbbc9c09f1..6609d04206b 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_https_server.a and b/tools/sdk/esp32c3/lib/libesp_https_server.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_hw_support.a b/tools/sdk/esp32c3/lib/libesp_hw_support.a index 58f3470da59..f837f5aee0f 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_hw_support.a and b/tools/sdk/esp32c3/lib/libesp_hw_support.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_ipc.a b/tools/sdk/esp32c3/lib/libesp_ipc.a index 4cf30751c8e..1ac92ed654d 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_ipc.a and b/tools/sdk/esp32c3/lib/libesp_ipc.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_lcd.a b/tools/sdk/esp32c3/lib/libesp_lcd.a index 35691442560..07bd7d00ff3 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_lcd.a and b/tools/sdk/esp32c3/lib/libesp_lcd.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_littlefs.a b/tools/sdk/esp32c3/lib/libesp_littlefs.a index 7caedd4cb4e..07501e6ed37 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_littlefs.a and b/tools/sdk/esp32c3/lib/libesp_littlefs.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_local_ctrl.a b/tools/sdk/esp32c3/lib/libesp_local_ctrl.a index 87fca04851c..f7418a24211 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_local_ctrl.a and b/tools/sdk/esp32c3/lib/libesp_local_ctrl.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_netif.a b/tools/sdk/esp32c3/lib/libesp_netif.a index 7d2543a9900..a0d71db4ded 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_netif.a and b/tools/sdk/esp32c3/lib/libesp_netif.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_phy.a b/tools/sdk/esp32c3/lib/libesp_phy.a index a41473eb425..86a9a335af1 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_phy.a and b/tools/sdk/esp32c3/lib/libesp_phy.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_pm.a b/tools/sdk/esp32c3/lib/libesp_pm.a index 78c0d0da668..484e55cd670 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_pm.a and b/tools/sdk/esp32c3/lib/libesp_pm.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_ringbuf.a b/tools/sdk/esp32c3/lib/libesp_ringbuf.a index 69f69acbd0f..9a29937a0dd 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_ringbuf.a and b/tools/sdk/esp32c3/lib/libesp_ringbuf.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_rom.a b/tools/sdk/esp32c3/lib/libesp_rom.a index 592f1ae7f3e..fc57101d668 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_rom.a and b/tools/sdk/esp32c3/lib/libesp_rom.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a b/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a index 1e7d74c8e11..b797cdda3ef 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a and b/tools/sdk/esp32c3/lib/libesp_serial_slave_link.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_system.a b/tools/sdk/esp32c3/lib/libesp_system.a index 38644bcfc7d..79e5dcbaa20 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_system.a and b/tools/sdk/esp32c3/lib/libesp_system.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_timer.a b/tools/sdk/esp32c3/lib/libesp_timer.a index e2d79fcff3e..2e39795a671 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_timer.a and b/tools/sdk/esp32c3/lib/libesp_timer.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_websocket_client.a b/tools/sdk/esp32c3/lib/libesp_websocket_client.a index 3216d082102..66ecbb17c2a 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_websocket_client.a and b/tools/sdk/esp32c3/lib/libesp_websocket_client.a differ diff --git a/tools/sdk/esp32c3/lib/libesp_wifi.a b/tools/sdk/esp32c3/lib/libesp_wifi.a index c19a0eaf03b..1886b62d933 100644 Binary files a/tools/sdk/esp32c3/lib/libesp_wifi.a and b/tools/sdk/esp32c3/lib/libesp_wifi.a differ diff --git a/tools/sdk/esp32c3/lib/libespcoredump.a b/tools/sdk/esp32c3/lib/libespcoredump.a index 8aeb6ced935..3b232cdf926 100644 Binary files a/tools/sdk/esp32c3/lib/libespcoredump.a and b/tools/sdk/esp32c3/lib/libespcoredump.a differ diff --git a/tools/sdk/esp32c3/lib/libespnow.a b/tools/sdk/esp32c3/lib/libespnow.a index 12a9b46563e..149e0b0b61a 100644 Binary files a/tools/sdk/esp32c3/lib/libespnow.a and b/tools/sdk/esp32c3/lib/libespnow.a differ diff --git a/tools/sdk/esp32c3/lib/libexpat.a b/tools/sdk/esp32c3/lib/libexpat.a index 67f0775bd4b..85977a0260a 100644 Binary files a/tools/sdk/esp32c3/lib/libexpat.a and b/tools/sdk/esp32c3/lib/libexpat.a differ diff --git a/tools/sdk/esp32c3/lib/libfatfs.a b/tools/sdk/esp32c3/lib/libfatfs.a index d6f9906378a..037fc6ee4d0 100644 Binary files a/tools/sdk/esp32c3/lib/libfatfs.a and b/tools/sdk/esp32c3/lib/libfatfs.a differ diff --git a/tools/sdk/esp32c3/lib/libfb_gfx.a b/tools/sdk/esp32c3/lib/libfb_gfx.a index 2aa5ac55af4..9dbffc74192 100644 Binary files a/tools/sdk/esp32c3/lib/libfb_gfx.a and b/tools/sdk/esp32c3/lib/libfb_gfx.a differ diff --git a/tools/sdk/esp32c3/lib/libfreemodbus.a b/tools/sdk/esp32c3/lib/libfreemodbus.a index e303f03914c..80f9ee9e965 100644 Binary files a/tools/sdk/esp32c3/lib/libfreemodbus.a and b/tools/sdk/esp32c3/lib/libfreemodbus.a differ diff --git a/tools/sdk/esp32c3/lib/libfreertos.a b/tools/sdk/esp32c3/lib/libfreertos.a index 3c6030de7ba..3b1bbf73caa 100644 Binary files a/tools/sdk/esp32c3/lib/libfreertos.a and b/tools/sdk/esp32c3/lib/libfreertos.a differ diff --git a/tools/sdk/esp32c3/lib/libhal.a b/tools/sdk/esp32c3/lib/libhal.a index 27d8de9b72a..6edb615c361 100644 Binary files a/tools/sdk/esp32c3/lib/libhal.a and b/tools/sdk/esp32c3/lib/libhal.a differ diff --git a/tools/sdk/esp32c3/lib/libheap.a b/tools/sdk/esp32c3/lib/libheap.a index 9981ca67b89..c0b1ec07680 100644 Binary files a/tools/sdk/esp32c3/lib/libheap.a and b/tools/sdk/esp32c3/lib/libheap.a differ diff --git a/tools/sdk/esp32c3/lib/libjsmn.a b/tools/sdk/esp32c3/lib/libjsmn.a index 5950be7295f..6bde26f606e 100644 Binary files a/tools/sdk/esp32c3/lib/libjsmn.a and b/tools/sdk/esp32c3/lib/libjsmn.a differ diff --git a/tools/sdk/esp32c3/lib/libjson.a b/tools/sdk/esp32c3/lib/libjson.a index 32b52588826..06ae86bcd2e 100644 Binary files a/tools/sdk/esp32c3/lib/libjson.a and b/tools/sdk/esp32c3/lib/libjson.a differ diff --git a/tools/sdk/esp32c3/lib/liblibsodium.a b/tools/sdk/esp32c3/lib/liblibsodium.a index b4a51233d86..a96ceb4f9db 100644 Binary files a/tools/sdk/esp32c3/lib/liblibsodium.a and b/tools/sdk/esp32c3/lib/liblibsodium.a differ diff --git a/tools/sdk/esp32c3/lib/liblog.a b/tools/sdk/esp32c3/lib/liblog.a index 5cd69950b07..ee9f212da40 100644 Binary files a/tools/sdk/esp32c3/lib/liblog.a and b/tools/sdk/esp32c3/lib/liblog.a differ diff --git a/tools/sdk/esp32c3/lib/liblwip.a b/tools/sdk/esp32c3/lib/liblwip.a index 38e4302fcec..f6045ef4fc0 100644 Binary files a/tools/sdk/esp32c3/lib/liblwip.a and b/tools/sdk/esp32c3/lib/liblwip.a differ diff --git a/tools/sdk/esp32c3/lib/libmbedcrypto.a b/tools/sdk/esp32c3/lib/libmbedcrypto.a index eaedb7dfc71..41bdfb8fd42 100644 Binary files a/tools/sdk/esp32c3/lib/libmbedcrypto.a and b/tools/sdk/esp32c3/lib/libmbedcrypto.a differ diff --git a/tools/sdk/esp32c3/lib/libmbedtls.a b/tools/sdk/esp32c3/lib/libmbedtls.a index ca8c3531713..75fe33d87b4 100644 Binary files a/tools/sdk/esp32c3/lib/libmbedtls.a and b/tools/sdk/esp32c3/lib/libmbedtls.a differ diff --git a/tools/sdk/esp32c3/lib/libmbedx509.a b/tools/sdk/esp32c3/lib/libmbedx509.a index 3faa1b8ced2..d2b99f5e180 100644 Binary files a/tools/sdk/esp32c3/lib/libmbedx509.a and b/tools/sdk/esp32c3/lib/libmbedx509.a differ diff --git a/tools/sdk/esp32c3/lib/libmdns.a b/tools/sdk/esp32c3/lib/libmdns.a index 0929de83b4b..75d14aa4e1f 100644 Binary files a/tools/sdk/esp32c3/lib/libmdns.a and b/tools/sdk/esp32c3/lib/libmdns.a differ diff --git a/tools/sdk/esp32c3/lib/libmesh.a b/tools/sdk/esp32c3/lib/libmesh.a index 7ba6b82c8eb..c5a1c84d27a 100644 Binary files a/tools/sdk/esp32c3/lib/libmesh.a and b/tools/sdk/esp32c3/lib/libmesh.a differ diff --git a/tools/sdk/esp32c3/lib/libmqtt.a b/tools/sdk/esp32c3/lib/libmqtt.a index 8fad3a2a9a5..b09b65a5cfd 100644 Binary files a/tools/sdk/esp32c3/lib/libmqtt.a and b/tools/sdk/esp32c3/lib/libmqtt.a differ diff --git a/tools/sdk/esp32c3/lib/libnet80211.a b/tools/sdk/esp32c3/lib/libnet80211.a index 77e1dacb106..972d8440a2b 100644 Binary files a/tools/sdk/esp32c3/lib/libnet80211.a and b/tools/sdk/esp32c3/lib/libnet80211.a differ diff --git a/tools/sdk/esp32c3/lib/libnewlib.a b/tools/sdk/esp32c3/lib/libnewlib.a index f22f3650051..4ba44f5ef8c 100644 Binary files a/tools/sdk/esp32c3/lib/libnewlib.a and b/tools/sdk/esp32c3/lib/libnewlib.a differ diff --git a/tools/sdk/esp32c3/lib/libnghttp.a b/tools/sdk/esp32c3/lib/libnghttp.a index fc426bdd823..63fe6ef61d6 100644 Binary files a/tools/sdk/esp32c3/lib/libnghttp.a and b/tools/sdk/esp32c3/lib/libnghttp.a differ diff --git a/tools/sdk/esp32c3/lib/libnvs_flash.a b/tools/sdk/esp32c3/lib/libnvs_flash.a index 758072600a5..b425e4852df 100644 Binary files a/tools/sdk/esp32c3/lib/libnvs_flash.a and b/tools/sdk/esp32c3/lib/libnvs_flash.a differ diff --git a/tools/sdk/esp32c3/lib/libopenssl.a b/tools/sdk/esp32c3/lib/libopenssl.a index 6e997149caf..4549459a677 100644 Binary files a/tools/sdk/esp32c3/lib/libopenssl.a and b/tools/sdk/esp32c3/lib/libopenssl.a differ diff --git a/tools/sdk/esp32c3/lib/libpp.a b/tools/sdk/esp32c3/lib/libpp.a index 242a07592c1..0ff92c9beb8 100644 Binary files a/tools/sdk/esp32c3/lib/libpp.a and b/tools/sdk/esp32c3/lib/libpp.a differ diff --git a/tools/sdk/esp32c3/lib/libprotobuf-c.a b/tools/sdk/esp32c3/lib/libprotobuf-c.a index 7c4eef45ab9..8b2297d3b09 100644 Binary files a/tools/sdk/esp32c3/lib/libprotobuf-c.a and b/tools/sdk/esp32c3/lib/libprotobuf-c.a differ diff --git a/tools/sdk/esp32c3/lib/libprotocomm.a b/tools/sdk/esp32c3/lib/libprotocomm.a index 6a4a7298e0e..3848a9b02e6 100644 Binary files a/tools/sdk/esp32c3/lib/libprotocomm.a and b/tools/sdk/esp32c3/lib/libprotocomm.a differ diff --git a/tools/sdk/esp32c3/lib/libpthread.a b/tools/sdk/esp32c3/lib/libpthread.a index 84bddedf419..94d0af708e2 100644 Binary files a/tools/sdk/esp32c3/lib/libpthread.a and b/tools/sdk/esp32c3/lib/libpthread.a differ diff --git a/tools/sdk/esp32c3/lib/libriscv.a b/tools/sdk/esp32c3/lib/libriscv.a index 9aab3f6668e..c8ee9762f32 100644 Binary files a/tools/sdk/esp32c3/lib/libriscv.a and b/tools/sdk/esp32c3/lib/libriscv.a differ diff --git a/tools/sdk/esp32c3/lib/libsdmmc.a b/tools/sdk/esp32c3/lib/libsdmmc.a index e7e31179d7d..2f33b9a9d5e 100644 Binary files a/tools/sdk/esp32c3/lib/libsdmmc.a and b/tools/sdk/esp32c3/lib/libsdmmc.a differ diff --git a/tools/sdk/esp32c3/lib/libsmartconfig.a b/tools/sdk/esp32c3/lib/libsmartconfig.a index d124c490bf8..52eb50f3847 100644 Binary files a/tools/sdk/esp32c3/lib/libsmartconfig.a and b/tools/sdk/esp32c3/lib/libsmartconfig.a differ diff --git a/tools/sdk/esp32c3/lib/libsoc.a b/tools/sdk/esp32c3/lib/libsoc.a index eb02ac95245..c7fd9ffdfed 100644 Binary files a/tools/sdk/esp32c3/lib/libsoc.a and b/tools/sdk/esp32c3/lib/libsoc.a differ diff --git a/tools/sdk/esp32c3/lib/libspi_flash.a b/tools/sdk/esp32c3/lib/libspi_flash.a index 1559494325c..2a0f65981fb 100644 Binary files a/tools/sdk/esp32c3/lib/libspi_flash.a and b/tools/sdk/esp32c3/lib/libspi_flash.a differ diff --git a/tools/sdk/esp32c3/lib/libspiffs.a b/tools/sdk/esp32c3/lib/libspiffs.a index 52deda42967..e754b36ad05 100644 Binary files a/tools/sdk/esp32c3/lib/libspiffs.a and b/tools/sdk/esp32c3/lib/libspiffs.a differ diff --git a/tools/sdk/esp32c3/lib/libtcp_transport.a b/tools/sdk/esp32c3/lib/libtcp_transport.a index ea1006cbf9b..f48c7b45063 100644 Binary files a/tools/sdk/esp32c3/lib/libtcp_transport.a and b/tools/sdk/esp32c3/lib/libtcp_transport.a differ diff --git a/tools/sdk/esp32c3/lib/libtcpip_adapter.a b/tools/sdk/esp32c3/lib/libtcpip_adapter.a index 5dd132c9682..c15bde623c2 100644 Binary files a/tools/sdk/esp32c3/lib/libtcpip_adapter.a and b/tools/sdk/esp32c3/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/esp32c3/lib/libunity.a b/tools/sdk/esp32c3/lib/libunity.a index ebf6762648b..736e24b10a6 100644 Binary files a/tools/sdk/esp32c3/lib/libunity.a and b/tools/sdk/esp32c3/lib/libunity.a differ diff --git a/tools/sdk/esp32c3/lib/libvfs.a b/tools/sdk/esp32c3/lib/libvfs.a index 7d31f062f1b..fe76f424f49 100644 Binary files a/tools/sdk/esp32c3/lib/libvfs.a and b/tools/sdk/esp32c3/lib/libvfs.a differ diff --git a/tools/sdk/esp32c3/lib/libwapi.a b/tools/sdk/esp32c3/lib/libwapi.a index 30dd7ac2a8a..08a268fc906 100644 Binary files a/tools/sdk/esp32c3/lib/libwapi.a and b/tools/sdk/esp32c3/lib/libwapi.a differ diff --git a/tools/sdk/esp32c3/lib/libwear_levelling.a b/tools/sdk/esp32c3/lib/libwear_levelling.a index f93377c5da7..6faf5f9ceee 100644 Binary files a/tools/sdk/esp32c3/lib/libwear_levelling.a and b/tools/sdk/esp32c3/lib/libwear_levelling.a differ diff --git a/tools/sdk/esp32c3/lib/libwifi_provisioning.a b/tools/sdk/esp32c3/lib/libwifi_provisioning.a index 1e36993f892..0273edbc296 100644 Binary files a/tools/sdk/esp32c3/lib/libwifi_provisioning.a and b/tools/sdk/esp32c3/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/esp32c3/lib/libwpa_supplicant.a b/tools/sdk/esp32c3/lib/libwpa_supplicant.a index 2accc2c0916..1cd84fcda9d 100644 Binary files a/tools/sdk/esp32c3/lib/libwpa_supplicant.a and b/tools/sdk/esp32c3/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/esp32c3/sdkconfig b/tools/sdk/esp32c3/sdkconfig index 1b8c58de9f5..2cceb4ecc9b 100644 --- a/tools/sdk/esp32c3/sdkconfig +++ b/tools/sdk/esp32c3/sdkconfig @@ -95,7 +95,6 @@ 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_26M is not set @@ -787,6 +786,8 @@ CONFIG_ESP_CONSOLE_UART_DEFAULT=y # 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_UART=y CONFIG_ESP_CONSOLE_UART_NUM=0 CONFIG_ESP_CONSOLE_UART_BAUDRATE=115200 @@ -841,6 +842,7 @@ CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT=y # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # CONFIG_ESP_WIFI_GCMP_SUPPORT is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # end of Wi-Fi # @@ -1047,6 +1049,7 @@ CONFIG_LWIP_GARP_TMR_INTERVAL=60 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=128 @@ -1131,8 +1134,9 @@ CONFIG_LWIP_MAX_RAW_PCBS=16 # # SNTP # -CONFIG_LWIP_SNTP_MAX_SERVERS=1 -# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_MAX_SERVERS=3 +CONFIG_LWIP_DHCP_GET_NTP_SRV=y +CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP diff --git a/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin b/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin index 38bb414d787..d15a1d22c9b 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_dio_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin b/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin index d454c318da5..f5a22f88a6e 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_dio_80m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin b/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin index 425e8a4adec..18b8ac82cfb 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_dout_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin b/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin index bd6f458ee2d..73716ffffee 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_dout_80m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin b/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin index f2ca21c91f3..8a89af1b14a 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_qio_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin b/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin index 94e44340c3e..d5cb266d8aa 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_qio_80m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin b/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin index 838fec2d4a2..3e08d59b321 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin and b/tools/sdk/esp32s2/bin/bootloader_qout_40m.bin differ diff --git a/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin b/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin index e678a4d3e9c..4ac736f2c48 100644 Binary files a/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin and b/tools/sdk/esp32s2/bin/bootloader_qout_80m.bin differ diff --git a/tools/sdk/esp32s2/include/app_trace/include/esp_app_trace_util.h b/tools/sdk/esp32s2/include/app_trace/include/esp_app_trace_util.h index 0ee501b27fa..96595c69827 100644 --- a/tools/sdk/esp32s2/include/app_trace/include/esp_app_trace_util.h +++ b/tools/sdk/esp32s2/include/app_trace/include/esp_app_trace_util.h @@ -68,7 +68,7 @@ typedef struct { */ static inline void esp_apptrace_lock_init(esp_apptrace_lock_t *lock) { - vPortCPUInitializeMutex(&lock->mux); + portMUX_INITIALIZE(&lock->mux); lock->int_state = 0; } diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_device.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_device.h index 7f67fa9cff0..078b67349dc 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_device.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/class/hid/hid_device.h @@ -310,8 +310,8 @@ static inline bool tud_hid_gamepad_report(uint8_t report_id, int8_t x, int8_t y HID_COLLECTION_END \ // Gamepad Report Descriptor Template -// with 16 buttons, 2 joysticks and 1 hat/dpad with following layout -// | X | Y | Z | Rz | Rx | Ry (1 byte each) | hat/DPAD (1 byte) | Button Map (2 bytes) | +// with 32 buttons, 2 joysticks and 1 hat/dpad with following layout +// | X | Y | Z | Rz | Rx | Ry (1 byte each) | hat/DPAD (1 byte) | Button Map (4 bytes) | #define TUD_HID_REPORT_DESC_GAMEPAD(...) \ HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\ HID_USAGE ( HID_USAGE_DESKTOP_GAMEPAD ) ,\ @@ -319,37 +319,37 @@ static inline bool tud_hid_gamepad_report(uint8_t report_id, int8_t x, int8_t y /* Report ID if any */\ __VA_ARGS__ \ /* 8 bit X, Y, Z, Rz, Rx, Ry (min -127, max 127 ) */ \ - HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\ - HID_USAGE ( HID_USAGE_DESKTOP_X ) ,\ - HID_USAGE ( HID_USAGE_DESKTOP_Y ) ,\ - HID_USAGE ( HID_USAGE_DESKTOP_Z ) ,\ - HID_USAGE ( HID_USAGE_DESKTOP_RZ ) ,\ - HID_USAGE ( HID_USAGE_DESKTOP_RX ) ,\ - HID_USAGE ( HID_USAGE_DESKTOP_RY ) ,\ - HID_LOGICAL_MIN ( 0x81 ) ,\ - HID_LOGICAL_MAX ( 0x7f ) ,\ - HID_REPORT_COUNT ( 6 ) ,\ - HID_REPORT_SIZE ( 8 ) ,\ - HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\ + HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\ + HID_USAGE ( HID_USAGE_DESKTOP_X ) ,\ + HID_USAGE ( HID_USAGE_DESKTOP_Y ) ,\ + HID_USAGE ( HID_USAGE_DESKTOP_Z ) ,\ + HID_USAGE ( HID_USAGE_DESKTOP_RZ ) ,\ + HID_USAGE ( HID_USAGE_DESKTOP_RX ) ,\ + HID_USAGE ( HID_USAGE_DESKTOP_RY ) ,\ + HID_LOGICAL_MIN ( 0x81 ) ,\ + HID_LOGICAL_MAX ( 0x7f ) ,\ + HID_REPORT_COUNT ( 6 ) ,\ + HID_REPORT_SIZE ( 8 ) ,\ + HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\ /* 8 bit DPad/Hat Button Map */ \ - HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\ - HID_USAGE ( HID_USAGE_DESKTOP_HAT_SWITCH ) ,\ - HID_LOGICAL_MIN ( 1 ) ,\ - HID_LOGICAL_MAX ( 8 ) ,\ - HID_PHYSICAL_MIN ( 0 ) ,\ - HID_PHYSICAL_MAX_N ( 315, 2 ) ,\ - HID_REPORT_COUNT ( 1 ) ,\ - HID_REPORT_SIZE ( 8 ) ,\ - HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\ - /* 16 bit Button Map */ \ - HID_USAGE_PAGE ( HID_USAGE_PAGE_BUTTON ) ,\ - HID_USAGE_MIN ( 1 ) ,\ - HID_USAGE_MAX ( 32 ) ,\ - HID_LOGICAL_MIN ( 0 ) ,\ - HID_LOGICAL_MAX ( 1 ) ,\ - HID_REPORT_COUNT ( 32 ) ,\ - HID_REPORT_SIZE ( 1 ) ,\ - HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\ + HID_USAGE_PAGE ( HID_USAGE_PAGE_DESKTOP ) ,\ + HID_USAGE ( HID_USAGE_DESKTOP_HAT_SWITCH ) ,\ + HID_LOGICAL_MIN ( 1 ) ,\ + HID_LOGICAL_MAX ( 8 ) ,\ + HID_PHYSICAL_MIN ( 0 ) ,\ + HID_PHYSICAL_MAX_N ( 315, 2 ) ,\ + HID_REPORT_COUNT ( 1 ) ,\ + HID_REPORT_SIZE ( 8 ) ,\ + HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\ + /* 32 bit Button Map */ \ + HID_USAGE_PAGE ( HID_USAGE_PAGE_BUTTON ) ,\ + HID_USAGE_MIN ( 1 ) ,\ + HID_USAGE_MAX ( 32 ) ,\ + HID_LOGICAL_MIN ( 0 ) ,\ + HID_LOGICAL_MAX ( 1 ) ,\ + HID_REPORT_COUNT ( 32 ) ,\ + HID_REPORT_SIZE ( 1 ) ,\ + HID_INPUT ( HID_DATA | HID_VARIABLE | HID_ABSOLUTE ) ,\ HID_COLLECTION_END \ // HID Generic Input & Output diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/dcd_attr.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/dcd_attr.h index 952a8b8c8b7..3c5dadaf4dc 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/dcd_attr.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/dcd_attr.h @@ -44,6 +44,7 @@ #elif TU_CHECK_MCU(OPT_MCU_LPC18XX, OPT_MCU_LPC43XX) // TODO USB0 has 6, USB1 has 4 + #define DCD_ATTR_CONTROLLER_CHIPIDEA_HS #define DCD_ATTR_ENDPOINT_MAX 6 #elif TU_CHECK_MCU(OPT_MCU_LPC51UXX) @@ -58,6 +59,7 @@ #define DCD_ATTR_ENDPOINT_MAX 6 #elif TU_CHECK_MCU(OPT_MCU_MIMXRT10XX) + #define DCD_ATTR_CONTROLLER_CHIPIDEA_HS #define DCD_ATTR_ENDPOINT_MAX 8 #elif TU_CHECK_MCU(OPT_MCU_MKL25ZXX, OPT_MCU_K32L2BXX) @@ -119,6 +121,9 @@ #define DCD_ATTR_ENDPOINT_MAX 9 #define DCD_ATTR_DWC2_STM32 +#elif TU_CHECK_MCU(OPT_MCU_STM32G4) + #define DCD_ATTR_ENDPOINT_MAX 8 + #elif TU_CHECK_MCU(OPT_MCU_STM32L0, OPT_MCU_STM32L1) #define DCD_ATTR_ENDPOINT_MAX 8 @@ -143,6 +148,9 @@ #elif TU_CHECK_MCU(OPT_MCU_MSP430x5xx) #define DCD_ATTR_ENDPOINT_MAX 8 +#elif TU_CHECK_MCU(OPT_MCU_MSP432E4, OPT_MCU_TM4C123, OPT_MCU_TM4C129) + #define DCD_ATTR_ENDPOINT_MAX 8 + //------------- ValentyUSB -------------// #elif TU_CHECK_MCU(OPT_MCU_VALENTYUSB_EPTRI) #define DCD_ATTR_ENDPOINT_MAX 16 @@ -185,6 +193,10 @@ #elif TU_CHECK_MCU(OPT_MCU_BCM2711) #define DCD_ATTR_ENDPOINT_MAX 8 +//------------- Broadcom -------------// +#elif TU_CHECK_MCU(OPT_MCU_XMC4000) + #define DCD_ATTR_ENDPOINT_MAX 8 + #else #warning "DCD_ATTR_ENDPOINT_MAX is not defined for this MCU, default to 8" #define DCD_ATTR_ENDPOINT_MAX 8 diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd.h index 8d02de1ff1f..ec34817fa40 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/device/usbd.h @@ -763,8 +763,8 @@ TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb #define CFG_TUD_BTH_ISO_ALT_COUNT 0 #endif -// Length of template descriptor: 30 bytes + number of ISO alternatives * 23 -#define TUD_BTH_DESC_LEN (9 + 7 + 7 + 7 + (CFG_TUD_BTH_ISO_ALT_COUNT) * (9 + 7 + 7)) +// Length of template descriptor: 38 bytes + number of ISO alternatives * 23 +#define TUD_BTH_DESC_LEN (8 + 9 + 7 + 7 + 7 + (CFG_TUD_BTH_ISO_ALT_COUNT) * (9 + 7 + 7)) /* Primary Interface */ #define TUD_BTH_PRI_ITF(_itfnum, _stridx, _ep_evt, _ep_evt_size, _ep_evt_interval, _ep_in, _ep_out, _ep_size) \ @@ -806,6 +806,8 @@ TU_ATTR_WEAK bool tud_vendor_control_xfer_cb(uint8_t rhport, uint8_t stage, tusb // Interface number, string index, attributes, event endpoint, event endpoint size, interval, data in, data out, data endpoint size, iso endpoint sizes // TODO BTH should also use IAD like CDC for composite device #define TUD_BTH_DESCRIPTOR(_itfnum, _stridx, _ep_evt, _ep_evt_size, _ep_evt_interval, _ep_in, _ep_out, _ep_size,...) \ + /* Interface Associate */\ + 8, TUSB_DESC_INTERFACE_ASSOCIATION, _itfnum, 2, TUD_BT_APP_CLASS, TUD_BT_APP_SUBCLASS, TUD_BT_PROTOCOL_PRIMARY_CONTROLLER, 0,\ TUD_BTH_PRI_ITF(_itfnum, _stridx, _ep_evt, _ep_evt_size, _ep_evt_interval, _ep_in, _ep_out, _ep_size) \ TUD_BTH_ISO_ITFS(_itfnum + 1, _ep_in + 1, _ep_out + 1, __VA_ARGS__) diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/chipidea/ci_hs/ci_hs_imxrt.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/chipidea/ci_hs/ci_hs_imxrt.h new file mode 100644 index 00000000000..78ca5a5a236 --- /dev/null +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/chipidea/ci_hs/ci_hs_imxrt.h @@ -0,0 +1,50 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021, Ha Thach (tinyusb.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * This file is part of the TinyUSB stack. + */ + +#ifndef _CI_HS_IMXRT_H_ +#define _CI_HS_IMXRT_H_ + +#include "fsl_device_registers.h" + +static const ci_hs_controller_t _ci_controller[] = +{ + // RT1010 and RT1020 only has 1 USB controller + #if FSL_FEATURE_SOC_USBHS_COUNT == 1 + { .reg_base = USB_BASE , .irqnum = USB_OTG1_IRQn, .ep_count = 8 } + #else + { .reg_base = USB1_BASE, .irqnum = USB_OTG1_IRQn, .ep_count = 8 }, + { .reg_base = USB2_BASE, .irqnum = USB_OTG2_IRQn, .ep_count = 8 } + #endif +}; + +#define CI_DCD_INT_ENABLE(_p) NVIC_EnableIRQ (_ci_controller[_p].irqnum) +#define CI_DCD_INT_DISABLE(_p) NVIC_DisableIRQ(_ci_controller[_p].irqnum) + +#define CI_HCD_INT_ENABLE(_p) NVIC_EnableIRQ (_ci_controller[_p].irqnum) +#define CI_HCD_INT_DISABLE(_p) NVIC_DisableIRQ(_ci_controller[_p].irqnum) + + +#endif diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/chipidea/ci_hs/ci_hs_lpc18_43.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/chipidea/ci_hs/ci_hs_lpc18_43.h new file mode 100644 index 00000000000..8c2e7dfa65c --- /dev/null +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/chipidea/ci_hs/ci_hs_lpc18_43.h @@ -0,0 +1,45 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021, Ha Thach (tinyusb.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * This file is part of the TinyUSB stack. + */ + +#ifndef _CI_HS_LPC18_43_H_ +#define _CI_HS_LPC18_43_H_ + +// LPCOpen for 18xx & 43xx +#include "chip.h" + +static const ci_hs_controller_t _ci_controller[] = +{ + { .reg_base = LPC_USB0_BASE, .irqnum = USB0_IRQn, .ep_count = 6 }, + { .reg_base = LPC_USB1_BASE, .irqnum = USB1_IRQn, .ep_count = 4 } +}; + +#define CI_DCD_INT_ENABLE(_p) NVIC_EnableIRQ (_ci_controller[_p].irqnum) +#define CI_DCD_INT_DISABLE(_p) NVIC_DisableIRQ(_ci_controller[_p].irqnum) + +#define CI_HCD_INT_ENABLE(_p) NVIC_EnableIRQ (_ci_controller[_p].irqnum) +#define CI_HCD_INT_DISABLE(_p) NVIC_DisableIRQ(_ci_controller[_p].irqnum) + +#endif diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/chipidea/ci_hs/ci_hs_type.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/chipidea/ci_hs/ci_hs_type.h new file mode 100644 index 00000000000..728a86b8664 --- /dev/null +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/chipidea/ci_hs/ci_hs_type.h @@ -0,0 +1,144 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021, Ha Thach (tinyusb.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * This file is part of the TinyUSB stack. + */ + +#ifndef CI_HS_TYPE_H_ +#define CI_HS_TYPE_H_ + +#ifdef __cplusplus + extern "C" { +#endif + +// USBCMD +enum { + USBCMD_RUN_STOP = TU_BIT(0), + USBCMD_RESET = TU_BIT(1), + USBCMD_SETUP_TRIPWIRE = TU_BIT(13), + USBCMD_ADD_QTD_TRIPWIRE = TU_BIT(14) ///< This bit is used as a semaphore to ensure the to proper addition of a new dTD to an active (primed) endpoint’s linked list. This bit is set and cleared by software during the process of adding a new dTD +// Interrupt Threshold bit 23:16 +}; + +// PORTSC1 +#define PORTSC1_PORT_SPEED_POS 26 + +enum { + PORTSC1_CURRENT_CONNECT_STATUS = TU_BIT(0), + PORTSC1_FORCE_PORT_RESUME = TU_BIT(6), + PORTSC1_SUSPEND = TU_BIT(7), + PORTSC1_FORCE_FULL_SPEED = TU_BIT(24), + PORTSC1_PORT_SPEED = TU_BIT(26) | TU_BIT(27) +}; + +// OTGSC +enum { + OTGSC_VBUS_DISCHARGE = TU_BIT(0), + OTGSC_VBUS_CHARGE = TU_BIT(1), +// OTGSC_HWASSIST_AUTORESET = TU_BIT(2), + OTGSC_OTG_TERMINATION = TU_BIT(3), ///< Must set to 1 when OTG go to device mode + OTGSC_DATA_PULSING = TU_BIT(4), + OTGSC_ID_PULLUP = TU_BIT(5), +// OTGSC_HWASSIT_DATA_PULSE = TU_BIT(6), +// OTGSC_HWASSIT_BDIS_ACONN = TU_BIT(7), + OTGSC_ID = TU_BIT(8), ///< 0 = A device, 1 = B Device + OTGSC_A_VBUS_VALID = TU_BIT(9), + OTGSC_A_SESSION_VALID = TU_BIT(10), + OTGSC_B_SESSION_VALID = TU_BIT(11), + OTGSC_B_SESSION_END = TU_BIT(12), + OTGSC_1MS_TOGGLE = TU_BIT(13), + OTGSC_DATA_BUS_PULSING_STATUS = TU_BIT(14), +}; + +// USBMode +enum { + USBMODE_CM_DEVICE = 2, + USBMODE_CM_HOST = 3, + + USBMODE_SLOM = TU_BIT(3), + USBMODE_SDIS = TU_BIT(4), + + USBMODE_VBUS_POWER_SELECT = TU_BIT(5), // Need to be enabled for LPC18XX/43XX in host mode +}; + +// Device Registers +typedef struct +{ + //------------- ID + HW Parameter Registers-------------// + volatile uint32_t TU_RESERVED[64]; ///< For iMX RT10xx, but not used by LPC18XX/LPC43XX + + //------------- Capability Registers-------------// + volatile uint8_t CAPLENGTH; ///< Capability Registers Length + volatile uint8_t TU_RESERVED[1]; + volatile uint16_t HCIVERSION; ///< Host Controller Interface Version + + volatile uint32_t HCSPARAMS; ///< Host Controller Structural Parameters + volatile uint32_t HCCPARAMS; ///< Host Controller Capability Parameters + volatile uint32_t TU_RESERVED[5]; + + volatile uint16_t DCIVERSION; ///< Device Controller Interface Version + volatile uint8_t TU_RESERVED[2]; + + volatile uint32_t DCCPARAMS; ///< Device Controller Capability Parameters + volatile uint32_t TU_RESERVED[6]; + + //------------- Operational Registers -------------// + volatile uint32_t USBCMD; ///< USB Command Register + volatile uint32_t USBSTS; ///< USB Status Register + volatile uint32_t USBINTR; ///< Interrupt Enable Register + volatile uint32_t FRINDEX; ///< USB Frame Index + volatile uint32_t TU_RESERVED; + volatile uint32_t DEVICEADDR; ///< Device Address + volatile uint32_t ENDPTLISTADDR; ///< Endpoint List Address + volatile uint32_t TU_RESERVED; + volatile uint32_t BURSTSIZE; ///< Programmable Burst Size + volatile uint32_t TXFILLTUNING; ///< TX FIFO Fill Tuning + uint32_t TU_RESERVED[4]; + volatile uint32_t ENDPTNAK; ///< Endpoint NAK + volatile uint32_t ENDPTNAKEN; ///< Endpoint NAK Enable + volatile uint32_t TU_RESERVED; + volatile uint32_t PORTSC1; ///< Port Status & Control + volatile uint32_t TU_RESERVED[7]; + volatile uint32_t OTGSC; ///< On-The-Go Status & control + volatile uint32_t USBMODE; ///< USB Device Mode + volatile uint32_t ENDPTSETUPSTAT; ///< Endpoint Setup Status + volatile uint32_t ENDPTPRIME; ///< Endpoint Prime + volatile uint32_t ENDPTFLUSH; ///< Endpoint Flush + volatile uint32_t ENDPTSTAT; ///< Endpoint Status + volatile uint32_t ENDPTCOMPLETE; ///< Endpoint Complete + volatile uint32_t ENDPTCTRL[8]; ///< Endpoint Control 0 - 7 +} ci_hs_regs_t; + + +typedef struct +{ + uint32_t reg_base; + uint32_t irqnum; + uint8_t ep_count; // Max bi-directional Endpoints +}ci_hs_controller_t; + +#ifdef __cplusplus + } +#endif + +#endif /* CI_HS_TYPE_H_ */ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/mentor/musb/musb_msp432e.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/mentor/musb/musb_msp432e.h new file mode 100644 index 00000000000..fce21de8890 --- /dev/null +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/mentor/musb/musb_msp432e.h @@ -0,0 +1,40 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021, Ha Thach (tinyusb.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * This file is part of the TinyUSB stack. + */ + +#ifndef _TUSB_MUSB_MSP432E_H_ +#define _TUSB_MUSB_MSP432E_H_ + +#ifdef __cplusplus + extern "C" { +#endif + +#include "msp.h" + +#ifdef __cplusplus + } +#endif + +#endif diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/mentor/musb/musb_tm4c.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/mentor/musb/musb_tm4c.h new file mode 100644 index 00000000000..65a1751b0f1 --- /dev/null +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/mentor/musb/musb_tm4c.h @@ -0,0 +1,45 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021, Ha Thach (tinyusb.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * This file is part of the TinyUSB stack. + */ + +#ifndef _TUSB_MUSB_TM4C_H_ +#define _TUSB_MUSB_TM4C_H_ + +#ifdef __cplusplus + extern "C" { +#endif + +#if CFG_TUSB_MCU == OPT_MCU_TM4C123 + #include "TM4C123.h" +//#elif CFG_TUSB_MCU == OPT_MCU_TM4C129 +#else + #error "Unsupported MCUs" +#endif + +#ifdef __cplusplus + } +#endif + +#endif diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/mentor/musb/musb_type.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/mentor/musb/musb_type.h new file mode 100644 index 00000000000..8f83305a526 --- /dev/null +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/mentor/musb/musb_type.h @@ -0,0 +1,2624 @@ +/****************************************************************************** +* +* Copyright (C) 2018 Texas Instruments Incorporated - http://www.ti.com/ +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* +* Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* +* Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the +* distribution. +* +* Neither the name of Texas Instruments Incorporated nor the names of +* its contributors may be used to endorse or promote products derived +* from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*******************************************************************************/ + +#ifndef _TUSB_MUSB_TYPE_H_ +#define _TUSB_MUSB_TYPE_H_ + +#ifdef __cplusplus + extern "C" { +#endif + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FADDR register. +// +//***************************************************************************** +#define USB_FADDR_M 0x0000007F // Function Address +#define USB_FADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_POWER register. +// +//***************************************************************************** +#define USB_POWER_ISOUP 0x00000080 // Isochronous Update +#define USB_POWER_SOFTCONN 0x00000040 // Soft Connect/Disconnect +#define USB_POWER_HSENAB 0x00000020 // High Speed Enable +#define USB_POWER_HSMODE 0x00000010 // High Speed Enable +#define USB_POWER_RESET 0x00000008 // RESET Signaling +#define USB_POWER_RESUME 0x00000004 // RESUME Signaling +#define USB_POWER_SUSPEND 0x00000002 // SUSPEND Mode +#define USB_POWER_PWRDNPHY 0x00000001 // Power Down PHY + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXIS register. +// +//***************************************************************************** +#define USB_TXIS_EP7 0x00000080 // TX Endpoint 7 Interrupt +#define USB_TXIS_EP6 0x00000040 // TX Endpoint 6 Interrupt +#define USB_TXIS_EP5 0x00000020 // TX Endpoint 5 Interrupt +#define USB_TXIS_EP4 0x00000010 // TX Endpoint 4 Interrupt +#define USB_TXIS_EP3 0x00000008 // TX Endpoint 3 Interrupt +#define USB_TXIS_EP2 0x00000004 // TX Endpoint 2 Interrupt +#define USB_TXIS_EP1 0x00000002 // TX Endpoint 1 Interrupt +#define USB_TXIS_EP0 0x00000001 // TX and RX Endpoint 0 Interrupt + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXIS register. +// +//***************************************************************************** +#define USB_RXIS_EP7 0x00000080 // RX Endpoint 7 Interrupt +#define USB_RXIS_EP6 0x00000040 // RX Endpoint 6 Interrupt +#define USB_RXIS_EP5 0x00000020 // RX Endpoint 5 Interrupt +#define USB_RXIS_EP4 0x00000010 // RX Endpoint 4 Interrupt +#define USB_RXIS_EP3 0x00000008 // RX Endpoint 3 Interrupt +#define USB_RXIS_EP2 0x00000004 // RX Endpoint 2 Interrupt +#define USB_RXIS_EP1 0x00000002 // RX Endpoint 1 Interrupt + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXIE register. +// +//***************************************************************************** +#define USB_TXIE_EP7 0x00000080 // TX Endpoint 7 Interrupt Enable +#define USB_TXIE_EP6 0x00000040 // TX Endpoint 6 Interrupt Enable +#define USB_TXIE_EP5 0x00000020 // TX Endpoint 5 Interrupt Enable +#define USB_TXIE_EP4 0x00000010 // TX Endpoint 4 Interrupt Enable +#define USB_TXIE_EP3 0x00000008 // TX Endpoint 3 Interrupt Enable +#define USB_TXIE_EP2 0x00000004 // TX Endpoint 2 Interrupt Enable +#define USB_TXIE_EP1 0x00000002 // TX Endpoint 1 Interrupt Enable +#define USB_TXIE_EP0 0x00000001 // TX and RX Endpoint 0 Interrupt + // Enable + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXIE register. +// +//***************************************************************************** +#define USB_RXIE_EP7 0x00000080 // RX Endpoint 7 Interrupt Enable +#define USB_RXIE_EP6 0x00000040 // RX Endpoint 6 Interrupt Enable +#define USB_RXIE_EP5 0x00000020 // RX Endpoint 5 Interrupt Enable +#define USB_RXIE_EP4 0x00000010 // RX Endpoint 4 Interrupt Enable +#define USB_RXIE_EP3 0x00000008 // RX Endpoint 3 Interrupt Enable +#define USB_RXIE_EP2 0x00000004 // RX Endpoint 2 Interrupt Enable +#define USB_RXIE_EP1 0x00000002 // RX Endpoint 1 Interrupt Enable + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_IS register. +// +//***************************************************************************** +#define USB_IS_VBUSERR 0x00000080 // VBUS Error (OTG only) +#define USB_IS_SESREQ 0x00000040 // SESSION REQUEST (OTG only) +#define USB_IS_DISCON 0x00000020 // Session Disconnect (OTG only) +#define USB_IS_CONN 0x00000010 // Session Connect +#define USB_IS_SOF 0x00000008 // Start of Frame +#define USB_IS_BABBLE 0x00000004 // Babble Detected +#define USB_IS_RESET 0x00000004 // RESET Signaling Detected +#define USB_IS_RESUME 0x00000002 // RESUME Signaling Detected +#define USB_IS_SUSPEND 0x00000001 // SUSPEND Signaling Detected + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_IE register. +// +//***************************************************************************** +#define USB_IE_VBUSERR 0x00000080 // Enable VBUS Error Interrupt (OTG + // only) +#define USB_IE_SESREQ 0x00000040 // Enable Session Request (OTG + // only) +#define USB_IE_DISCON 0x00000020 // Enable Disconnect Interrupt +#define USB_IE_CONN 0x00000010 // Enable Connect Interrupt +#define USB_IE_SOF 0x00000008 // Enable Start-of-Frame Interrupt +#define USB_IE_BABBLE 0x00000004 // Enable Babble Interrupt +#define USB_IE_RESET 0x00000004 // Enable RESET Interrupt +#define USB_IE_RESUME 0x00000002 // Enable RESUME Interrupt +#define USB_IE_SUSPND 0x00000001 // Enable SUSPEND Interrupt + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FRAME register. +// +//***************************************************************************** +#define USB_FRAME_M 0x000007FF // Frame Number +#define USB_FRAME_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_EPIDX register. +// +//***************************************************************************** +#define USB_EPIDX_EPIDX_M 0x0000000F // Endpoint Index +#define USB_EPIDX_EPIDX_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TEST register. +// +//***************************************************************************** +#define USB_TEST_FORCEH 0x00000080 // Force Host Mode +#define USB_TEST_FIFOACC 0x00000040 // FIFO Access +#define USB_TEST_FORCEFS 0x00000020 // Force Full-Speed Mode +#define USB_TEST_FORCEHS 0x00000010 // Force High-Speed Mode +#define USB_TEST_TESTPKT 0x00000008 // Test Packet Mode Enable +#define USB_TEST_TESTK 0x00000004 // Test_K Mode Enable +#define USB_TEST_TESTJ 0x00000002 // Test_J Mode Enable +#define USB_TEST_TESTSE0NAK 0x00000001 // Test_SE0_NAK Test Mode Enable + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FIFO0 register. +// +//***************************************************************************** +#define USB_FIFO0_EPDATA_M 0xFFFFFFFF // Endpoint Data +#define USB_FIFO0_EPDATA_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FIFO1 register. +// +//***************************************************************************** +#define USB_FIFO1_EPDATA_M 0xFFFFFFFF // Endpoint Data +#define USB_FIFO1_EPDATA_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FIFO2 register. +// +//***************************************************************************** +#define USB_FIFO2_EPDATA_M 0xFFFFFFFF // Endpoint Data +#define USB_FIFO2_EPDATA_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FIFO3 register. +// +//***************************************************************************** +#define USB_FIFO3_EPDATA_M 0xFFFFFFFF // Endpoint Data +#define USB_FIFO3_EPDATA_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FIFO4 register. +// +//***************************************************************************** +#define USB_FIFO4_EPDATA_M 0xFFFFFFFF // Endpoint Data +#define USB_FIFO4_EPDATA_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FIFO5 register. +// +//***************************************************************************** +#define USB_FIFO5_EPDATA_M 0xFFFFFFFF // Endpoint Data +#define USB_FIFO5_EPDATA_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FIFO6 register. +// +//***************************************************************************** +#define USB_FIFO6_EPDATA_M 0xFFFFFFFF // Endpoint Data +#define USB_FIFO6_EPDATA_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FIFO7 register. +// +//***************************************************************************** +#define USB_FIFO7_EPDATA_M 0xFFFFFFFF // Endpoint Data +#define USB_FIFO7_EPDATA_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DEVCTL register. +// +//***************************************************************************** +#define USB_DEVCTL_DEV 0x00000080 // Device Mode (OTG only) +#define USB_DEVCTL_FSDEV 0x00000040 // Full-Speed Device Detected +#define USB_DEVCTL_LSDEV 0x00000020 // Low-Speed Device Detected +#define USB_DEVCTL_VBUS_M 0x00000018 // VBUS Level (OTG only) +#define USB_DEVCTL_VBUS_NONE 0x00000000 // Below SessionEnd +#define USB_DEVCTL_VBUS_SEND 0x00000008 // Above SessionEnd, below AValid +#define USB_DEVCTL_VBUS_AVALID 0x00000010 // Above AValid, below VBUSValid +#define USB_DEVCTL_VBUS_VALID 0x00000018 // Above VBUSValid +#define USB_DEVCTL_HOST 0x00000004 // Host Mode +#define USB_DEVCTL_HOSTREQ 0x00000002 // Host Request (OTG only) +#define USB_DEVCTL_SESSION 0x00000001 // Session Start/End (OTG only) + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_CCONF register. +// +//***************************************************************************** +#define USB_CCONF_TXEDMA 0x00000002 // TX Early DMA Enable +#define USB_CCONF_RXEDMA 0x00000001 // TX Early DMA Enable + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXFIFOSZ register. +// +//***************************************************************************** +#define USB_TXFIFOSZ_DPB 0x00000010 // Double Packet Buffer Support +#define USB_TXFIFOSZ_SIZE_M 0x0000000F // Max Packet Size +#define USB_TXFIFOSZ_SIZE_8 0x00000000 // 8 +#define USB_TXFIFOSZ_SIZE_16 0x00000001 // 16 +#define USB_TXFIFOSZ_SIZE_32 0x00000002 // 32 +#define USB_TXFIFOSZ_SIZE_64 0x00000003 // 64 +#define USB_TXFIFOSZ_SIZE_128 0x00000004 // 128 +#define USB_TXFIFOSZ_SIZE_256 0x00000005 // 256 +#define USB_TXFIFOSZ_SIZE_512 0x00000006 // 512 +#define USB_TXFIFOSZ_SIZE_1024 0x00000007 // 1024 +#define USB_TXFIFOSZ_SIZE_2048 0x00000008 // 2048 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXFIFOSZ register. +// +//***************************************************************************** +#define USB_RXFIFOSZ_DPB 0x00000010 // Double Packet Buffer Support +#define USB_RXFIFOSZ_SIZE_M 0x0000000F // Max Packet Size +#define USB_RXFIFOSZ_SIZE_8 0x00000000 // 8 +#define USB_RXFIFOSZ_SIZE_16 0x00000001 // 16 +#define USB_RXFIFOSZ_SIZE_32 0x00000002 // 32 +#define USB_RXFIFOSZ_SIZE_64 0x00000003 // 64 +#define USB_RXFIFOSZ_SIZE_128 0x00000004 // 128 +#define USB_RXFIFOSZ_SIZE_256 0x00000005 // 256 +#define USB_RXFIFOSZ_SIZE_512 0x00000006 // 512 +#define USB_RXFIFOSZ_SIZE_1024 0x00000007 // 1024 +#define USB_RXFIFOSZ_SIZE_2048 0x00000008 // 2048 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXFIFOADD +// register. +// +//***************************************************************************** +#define USB_TXFIFOADD_ADDR_M 0x000001FF // Transmit/Receive Start Address +#define USB_TXFIFOADD_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXFIFOADD +// register. +// +//***************************************************************************** +#define USB_RXFIFOADD_ADDR_M 0x000001FF // Transmit/Receive Start Address +#define USB_RXFIFOADD_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_ULPIVBUSCTL +// register. +// +//***************************************************************************** +#define USB_ULPIVBUSCTL_USEEXTVBUSIND \ + 0x00000002 // Use External VBUS Indicator +#define USB_ULPIVBUSCTL_USEEXTVBUS \ + 0x00000001 // Use External VBUS + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_ULPIREGDATA +// register. +// +//***************************************************************************** +#define USB_ULPIREGDATA_REGDATA_M \ + 0x000000FF // Register Data +#define USB_ULPIREGDATA_REGDATA_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_ULPIREGADDR +// register. +// +//***************************************************************************** +#define USB_ULPIREGADDR_ADDR_M 0x000000FF // Register Address +#define USB_ULPIREGADDR_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_ULPIREGCTL +// register. +// +//***************************************************************************** +#define USB_ULPIREGCTL_RDWR 0x00000004 // Read/Write Control +#define USB_ULPIREGCTL_REGCMPLT 0x00000002 // Register Access Complete +#define USB_ULPIREGCTL_REGACC 0x00000001 // Initiate Register Access + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_EPINFO register. +// +//***************************************************************************** +#define USB_EPINFO_RXEP_M 0x000000F0 // RX Endpoints +#define USB_EPINFO_TXEP_M 0x0000000F // TX Endpoints +#define USB_EPINFO_RXEP_S 4 +#define USB_EPINFO_TXEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RAMINFO register. +// +//***************************************************************************** +#define USB_RAMINFO_DMACHAN_M 0x000000F0 // DMA Channels +#define USB_RAMINFO_RAMBITS_M 0x0000000F // RAM Address Bus Width +#define USB_RAMINFO_DMACHAN_S 4 +#define USB_RAMINFO_RAMBITS_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_CONTIM register. +// +//***************************************************************************** +#define USB_CONTIM_WTCON_M 0x000000F0 // Connect Wait +#define USB_CONTIM_WTID_M 0x0000000F // Wait ID +#define USB_CONTIM_WTCON_S 4 +#define USB_CONTIM_WTID_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_VPLEN register. +// +//***************************************************************************** +#define USB_VPLEN_VPLEN_M 0x000000FF // VBUS Pulse Length +#define USB_VPLEN_VPLEN_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_HSEOF register. +// +//***************************************************************************** +#define USB_HSEOF_HSEOFG_M 0x000000FF // HIgh-Speed End-of-Frame Gap +#define USB_HSEOF_HSEOFG_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_FSEOF register. +// +//***************************************************************************** +#define USB_FSEOF_FSEOFG_M 0x000000FF // Full-Speed End-of-Frame Gap +#define USB_FSEOF_FSEOFG_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_LSEOF register. +// +//***************************************************************************** +#define USB_LSEOF_LSEOFG_M 0x000000FF // Low-Speed End-of-Frame Gap +#define USB_LSEOF_LSEOFG_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXFUNCADDR0 +// register. +// +//***************************************************************************** +#define USB_TXFUNCADDR0_ADDR_M 0x0000007F // Device Address +#define USB_TXFUNCADDR0_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBADDR0 +// register. +// +//***************************************************************************** +#define USB_TXHUBADDR0_ADDR_M 0x0000007F // Hub Address +#define USB_TXHUBADDR0_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBPORT0 +// register. +// +//***************************************************************************** +#define USB_TXHUBPORT0_PORT_M 0x0000007F // Hub Port +#define USB_TXHUBPORT0_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXFUNCADDR1 +// register. +// +//***************************************************************************** +#define USB_TXFUNCADDR1_ADDR_M 0x0000007F // Device Address +#define USB_TXFUNCADDR1_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBADDR1 +// register. +// +//***************************************************************************** +#define USB_TXHUBADDR1_ADDR_M 0x0000007F // Hub Address +#define USB_TXHUBADDR1_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBPORT1 +// register. +// +//***************************************************************************** +#define USB_TXHUBPORT1_PORT_M 0x0000007F // Hub Port +#define USB_TXHUBPORT1_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXFUNCADDR1 +// register. +// +//***************************************************************************** +#define USB_RXFUNCADDR1_ADDR_M 0x0000007F // Device Address +#define USB_RXFUNCADDR1_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBADDR1 +// register. +// +//***************************************************************************** +#define USB_RXHUBADDR1_ADDR_M 0x0000007F // Hub Address +#define USB_RXHUBADDR1_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBPORT1 +// register. +// +//***************************************************************************** +#define USB_RXHUBPORT1_PORT_M 0x0000007F // Hub Port +#define USB_RXHUBPORT1_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXFUNCADDR2 +// register. +// +//***************************************************************************** +#define USB_TXFUNCADDR2_ADDR_M 0x0000007F // Device Address +#define USB_TXFUNCADDR2_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBADDR2 +// register. +// +//***************************************************************************** +#define USB_TXHUBADDR2_ADDR_M 0x0000007F // Hub Address +#define USB_TXHUBADDR2_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBPORT2 +// register. +// +//***************************************************************************** +#define USB_TXHUBPORT2_PORT_M 0x0000007F // Hub Port +#define USB_TXHUBPORT2_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXFUNCADDR2 +// register. +// +//***************************************************************************** +#define USB_RXFUNCADDR2_ADDR_M 0x0000007F // Device Address +#define USB_RXFUNCADDR2_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBADDR2 +// register. +// +//***************************************************************************** +#define USB_RXHUBADDR2_ADDR_M 0x0000007F // Hub Address +#define USB_RXHUBADDR2_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBPORT2 +// register. +// +//***************************************************************************** +#define USB_RXHUBPORT2_PORT_M 0x0000007F // Hub Port +#define USB_RXHUBPORT2_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXFUNCADDR3 +// register. +// +//***************************************************************************** +#define USB_TXFUNCADDR3_ADDR_M 0x0000007F // Device Address +#define USB_TXFUNCADDR3_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBADDR3 +// register. +// +//***************************************************************************** +#define USB_TXHUBADDR3_ADDR_M 0x0000007F // Hub Address +#define USB_TXHUBADDR3_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBPORT3 +// register. +// +//***************************************************************************** +#define USB_TXHUBPORT3_PORT_M 0x0000007F // Hub Port +#define USB_TXHUBPORT3_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXFUNCADDR3 +// register. +// +//***************************************************************************** +#define USB_RXFUNCADDR3_ADDR_M 0x0000007F // Device Address +#define USB_RXFUNCADDR3_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBADDR3 +// register. +// +//***************************************************************************** +#define USB_RXHUBADDR3_ADDR_M 0x0000007F // Hub Address +#define USB_RXHUBADDR3_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBPORT3 +// register. +// +//***************************************************************************** +#define USB_RXHUBPORT3_PORT_M 0x0000007F // Hub Port +#define USB_RXHUBPORT3_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXFUNCADDR4 +// register. +// +//***************************************************************************** +#define USB_TXFUNCADDR4_ADDR_M 0x0000007F // Device Address +#define USB_TXFUNCADDR4_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBADDR4 +// register. +// +//***************************************************************************** +#define USB_TXHUBADDR4_ADDR_M 0x0000007F // Hub Address +#define USB_TXHUBADDR4_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBPORT4 +// register. +// +//***************************************************************************** +#define USB_TXHUBPORT4_PORT_M 0x0000007F // Hub Port +#define USB_TXHUBPORT4_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXFUNCADDR4 +// register. +// +//***************************************************************************** +#define USB_RXFUNCADDR4_ADDR_M 0x0000007F // Device Address +#define USB_RXFUNCADDR4_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBADDR4 +// register. +// +//***************************************************************************** +#define USB_RXHUBADDR4_ADDR_M 0x0000007F // Hub Address +#define USB_RXHUBADDR4_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBPORT4 +// register. +// +//***************************************************************************** +#define USB_RXHUBPORT4_PORT_M 0x0000007F // Hub Port +#define USB_RXHUBPORT4_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXFUNCADDR5 +// register. +// +//***************************************************************************** +#define USB_TXFUNCADDR5_ADDR_M 0x0000007F // Device Address +#define USB_TXFUNCADDR5_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBADDR5 +// register. +// +//***************************************************************************** +#define USB_TXHUBADDR5_ADDR_M 0x0000007F // Hub Address +#define USB_TXHUBADDR5_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBPORT5 +// register. +// +//***************************************************************************** +#define USB_TXHUBPORT5_PORT_M 0x0000007F // Hub Port +#define USB_TXHUBPORT5_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXFUNCADDR5 +// register. +// +//***************************************************************************** +#define USB_RXFUNCADDR5_ADDR_M 0x0000007F // Device Address +#define USB_RXFUNCADDR5_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBADDR5 +// register. +// +//***************************************************************************** +#define USB_RXHUBADDR5_ADDR_M 0x0000007F // Hub Address +#define USB_RXHUBADDR5_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBPORT5 +// register. +// +//***************************************************************************** +#define USB_RXHUBPORT5_PORT_M 0x0000007F // Hub Port +#define USB_RXHUBPORT5_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXFUNCADDR6 +// register. +// +//***************************************************************************** +#define USB_TXFUNCADDR6_ADDR_M 0x0000007F // Device Address +#define USB_TXFUNCADDR6_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBADDR6 +// register. +// +//***************************************************************************** +#define USB_TXHUBADDR6_ADDR_M 0x0000007F // Hub Address +#define USB_TXHUBADDR6_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBPORT6 +// register. +// +//***************************************************************************** +#define USB_TXHUBPORT6_PORT_M 0x0000007F // Hub Port +#define USB_TXHUBPORT6_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXFUNCADDR6 +// register. +// +//***************************************************************************** +#define USB_RXFUNCADDR6_ADDR_M 0x0000007F // Device Address +#define USB_RXFUNCADDR6_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBADDR6 +// register. +// +//***************************************************************************** +#define USB_RXHUBADDR6_ADDR_M 0x0000007F // Hub Address +#define USB_RXHUBADDR6_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBPORT6 +// register. +// +//***************************************************************************** +#define USB_RXHUBPORT6_PORT_M 0x0000007F // Hub Port +#define USB_RXHUBPORT6_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXFUNCADDR7 +// register. +// +//***************************************************************************** +#define USB_TXFUNCADDR7_ADDR_M 0x0000007F // Device Address +#define USB_TXFUNCADDR7_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBADDR7 +// register. +// +//***************************************************************************** +#define USB_TXHUBADDR7_ADDR_M 0x0000007F // Hub Address +#define USB_TXHUBADDR7_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXHUBPORT7 +// register. +// +//***************************************************************************** +#define USB_TXHUBPORT7_PORT_M 0x0000007F // Hub Port +#define USB_TXHUBPORT7_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXFUNCADDR7 +// register. +// +//***************************************************************************** +#define USB_RXFUNCADDR7_ADDR_M 0x0000007F // Device Address +#define USB_RXFUNCADDR7_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBADDR7 +// register. +// +//***************************************************************************** +#define USB_RXHUBADDR7_ADDR_M 0x0000007F // Hub Address +#define USB_RXHUBADDR7_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXHUBPORT7 +// register. +// +//***************************************************************************** +#define USB_RXHUBPORT7_PORT_M 0x0000007F // Hub Port +#define USB_RXHUBPORT7_PORT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_CSRL0 register. +// +//***************************************************************************** +#define USB_CSRL0_NAKTO 0x00000080 // NAK Timeout +#define USB_CSRL0_SETENDC 0x00000080 // Setup End Clear +#define USB_CSRL0_STATUS 0x00000040 // STATUS Packet +#define USB_CSRL0_RXRDYC 0x00000040 // RXRDY Clear +#define USB_CSRL0_REQPKT 0x00000020 // Request Packet +#define USB_CSRL0_STALL 0x00000020 // Send Stall +#define USB_CSRL0_SETEND 0x00000010 // Setup End +#define USB_CSRL0_ERROR 0x00000010 // Error +#define USB_CSRL0_DATAEND 0x00000008 // Data End +#define USB_CSRL0_SETUP 0x00000008 // Setup Packet +#define USB_CSRL0_STALLED 0x00000004 // Endpoint Stalled +#define USB_CSRL0_TXRDY 0x00000002 // Transmit Packet Ready +#define USB_CSRL0_RXRDY 0x00000001 // Receive Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_CSRH0 register. +// +//***************************************************************************** +#define USB_CSRH0_DISPING 0x00000008 // PING Disable +#define USB_CSRH0_DTWE 0x00000004 // Data Toggle Write Enable +#define USB_CSRH0_DT 0x00000002 // Data Toggle +#define USB_CSRH0_FLUSH 0x00000001 // Flush FIFO + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_COUNT0 register. +// +//***************************************************************************** +#define USB_COUNT0_COUNT_M 0x0000007F // FIFO Count +#define USB_COUNT0_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TYPE0 register. +// +//***************************************************************************** +#define USB_TYPE0_SPEED_M 0x000000C0 // Operating Speed +#define USB_TYPE0_SPEED_HIGH 0x00000040 // High +#define USB_TYPE0_SPEED_FULL 0x00000080 // Full +#define USB_TYPE0_SPEED_LOW 0x000000C0 // Low + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_NAKLMT register. +// +//***************************************************************************** +#define USB_NAKLMT_NAKLMT_M 0x0000001F // EP0 NAK Limit +#define USB_NAKLMT_NAKLMT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXMAXP1 register. +// +//***************************************************************************** +#define USB_TXMAXP1_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_TXMAXP1_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRL1 register. +// +//***************************************************************************** +#define USB_TXCSRL1_NAKTO 0x00000080 // NAK Timeout +#define USB_TXCSRL1_CLRDT 0x00000040 // Clear Data Toggle +#define USB_TXCSRL1_STALLED 0x00000020 // Endpoint Stalled +#define USB_TXCSRL1_STALL 0x00000010 // Send STALL +#define USB_TXCSRL1_SETUP 0x00000010 // Setup Packet +#define USB_TXCSRL1_FLUSH 0x00000008 // Flush FIFO +#define USB_TXCSRL1_ERROR 0x00000004 // Error +#define USB_TXCSRL1_UNDRN 0x00000004 // Underrun +#define USB_TXCSRL1_FIFONE 0x00000002 // FIFO Not Empty +#define USB_TXCSRL1_TXRDY 0x00000001 // Transmit Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRH1 register. +// +//***************************************************************************** +#define USB_TXCSRH1_AUTOSET 0x00000080 // Auto Set +#define USB_TXCSRH1_ISO 0x00000040 // Isochronous Transfers +#define USB_TXCSRH1_MODE 0x00000020 // Mode +#define USB_TXCSRH1_DMAEN 0x00000010 // DMA Request Enable +#define USB_TXCSRH1_FDT 0x00000008 // Force Data Toggle +#define USB_TXCSRH1_DMAMOD 0x00000004 // DMA Request Mode +#define USB_TXCSRH1_DTWE 0x00000002 // Data Toggle Write Enable +#define USB_TXCSRH1_DT 0x00000001 // Data Toggle + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXMAXP1 register. +// +//***************************************************************************** +#define USB_RXMAXP1_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_RXMAXP1_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRL1 register. +// +//***************************************************************************** +#define USB_RXCSRL1_CLRDT 0x00000080 // Clear Data Toggle +#define USB_RXCSRL1_STALLED 0x00000040 // Endpoint Stalled +#define USB_RXCSRL1_STALL 0x00000020 // Send STALL +#define USB_RXCSRL1_REQPKT 0x00000020 // Request Packet +#define USB_RXCSRL1_FLUSH 0x00000010 // Flush FIFO +#define USB_RXCSRL1_DATAERR 0x00000008 // Data Error +#define USB_RXCSRL1_NAKTO 0x00000008 // NAK Timeout +#define USB_RXCSRL1_OVER 0x00000004 // Overrun +#define USB_RXCSRL1_ERROR 0x00000004 // Error +#define USB_RXCSRL1_FULL 0x00000002 // FIFO Full +#define USB_RXCSRL1_RXRDY 0x00000001 // Receive Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRH1 register. +// +//***************************************************************************** +#define USB_RXCSRH1_AUTOCL 0x00000080 // Auto Clear +#define USB_RXCSRH1_AUTORQ 0x00000040 // Auto Request +#define USB_RXCSRH1_ISO 0x00000040 // Isochronous Transfers +#define USB_RXCSRH1_DMAEN 0x00000020 // DMA Request Enable +#define USB_RXCSRH1_DISNYET 0x00000010 // Disable NYET +#define USB_RXCSRH1_PIDERR 0x00000010 // PID Error +#define USB_RXCSRH1_DMAMOD 0x00000008 // DMA Request Mode +#define USB_RXCSRH1_DTWE 0x00000004 // Data Toggle Write Enable +#define USB_RXCSRH1_DT 0x00000002 // Data Toggle +#define USB_RXCSRH1_INCOMPRX 0x00000001 // Incomplete RX Transmission + // Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCOUNT1 register. +// +//***************************************************************************** +#define USB_RXCOUNT1_COUNT_M 0x00001FFF // Receive Packet Count +#define USB_RXCOUNT1_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXTYPE1 register. +// +//***************************************************************************** +#define USB_TXTYPE1_SPEED_M 0x000000C0 // Operating Speed +#define USB_TXTYPE1_SPEED_DFLT 0x00000000 // Default +#define USB_TXTYPE1_SPEED_HIGH 0x00000040 // High +#define USB_TXTYPE1_SPEED_FULL 0x00000080 // Full +#define USB_TXTYPE1_SPEED_LOW 0x000000C0 // Low +#define USB_TXTYPE1_PROTO_M 0x00000030 // Protocol +#define USB_TXTYPE1_PROTO_CTRL 0x00000000 // Control +#define USB_TXTYPE1_PROTO_ISOC 0x00000010 // Isochronous +#define USB_TXTYPE1_PROTO_BULK 0x00000020 // Bulk +#define USB_TXTYPE1_PROTO_INT 0x00000030 // Interrupt +#define USB_TXTYPE1_TEP_M 0x0000000F // Target Endpoint Number +#define USB_TXTYPE1_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXINTERVAL1 +// register. +// +//***************************************************************************** +#define USB_TXINTERVAL1_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_TXINTERVAL1_TXPOLL_M \ + 0x000000FF // TX Polling +#define USB_TXINTERVAL1_TXPOLL_S \ + 0 +#define USB_TXINTERVAL1_NAKLMT_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXTYPE1 register. +// +//***************************************************************************** +#define USB_RXTYPE1_SPEED_M 0x000000C0 // Operating Speed +#define USB_RXTYPE1_SPEED_DFLT 0x00000000 // Default +#define USB_RXTYPE1_SPEED_HIGH 0x00000040 // High +#define USB_RXTYPE1_SPEED_FULL 0x00000080 // Full +#define USB_RXTYPE1_SPEED_LOW 0x000000C0 // Low +#define USB_RXTYPE1_PROTO_M 0x00000030 // Protocol +#define USB_RXTYPE1_PROTO_CTRL 0x00000000 // Control +#define USB_RXTYPE1_PROTO_ISOC 0x00000010 // Isochronous +#define USB_RXTYPE1_PROTO_BULK 0x00000020 // Bulk +#define USB_RXTYPE1_PROTO_INT 0x00000030 // Interrupt +#define USB_RXTYPE1_TEP_M 0x0000000F // Target Endpoint Number +#define USB_RXTYPE1_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXINTERVAL1 +// register. +// +//***************************************************************************** +#define USB_RXINTERVAL1_TXPOLL_M \ + 0x000000FF // RX Polling +#define USB_RXINTERVAL1_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_RXINTERVAL1_TXPOLL_S \ + 0 +#define USB_RXINTERVAL1_NAKLMT_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXMAXP2 register. +// +//***************************************************************************** +#define USB_TXMAXP2_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_TXMAXP2_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRL2 register. +// +//***************************************************************************** +#define USB_TXCSRL2_NAKTO 0x00000080 // NAK Timeout +#define USB_TXCSRL2_CLRDT 0x00000040 // Clear Data Toggle +#define USB_TXCSRL2_STALLED 0x00000020 // Endpoint Stalled +#define USB_TXCSRL2_SETUP 0x00000010 // Setup Packet +#define USB_TXCSRL2_STALL 0x00000010 // Send STALL +#define USB_TXCSRL2_FLUSH 0x00000008 // Flush FIFO +#define USB_TXCSRL2_ERROR 0x00000004 // Error +#define USB_TXCSRL2_UNDRN 0x00000004 // Underrun +#define USB_TXCSRL2_FIFONE 0x00000002 // FIFO Not Empty +#define USB_TXCSRL2_TXRDY 0x00000001 // Transmit Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRH2 register. +// +//***************************************************************************** +#define USB_TXCSRH2_AUTOSET 0x00000080 // Auto Set +#define USB_TXCSRH2_ISO 0x00000040 // Isochronous Transfers +#define USB_TXCSRH2_MODE 0x00000020 // Mode +#define USB_TXCSRH2_DMAEN 0x00000010 // DMA Request Enable +#define USB_TXCSRH2_FDT 0x00000008 // Force Data Toggle +#define USB_TXCSRH2_DMAMOD 0x00000004 // DMA Request Mode +#define USB_TXCSRH2_DTWE 0x00000002 // Data Toggle Write Enable +#define USB_TXCSRH2_DT 0x00000001 // Data Toggle + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXMAXP2 register. +// +//***************************************************************************** +#define USB_RXMAXP2_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_RXMAXP2_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRL2 register. +// +//***************************************************************************** +#define USB_RXCSRL2_CLRDT 0x00000080 // Clear Data Toggle +#define USB_RXCSRL2_STALLED 0x00000040 // Endpoint Stalled +#define USB_RXCSRL2_REQPKT 0x00000020 // Request Packet +#define USB_RXCSRL2_STALL 0x00000020 // Send STALL +#define USB_RXCSRL2_FLUSH 0x00000010 // Flush FIFO +#define USB_RXCSRL2_DATAERR 0x00000008 // Data Error +#define USB_RXCSRL2_NAKTO 0x00000008 // NAK Timeout +#define USB_RXCSRL2_ERROR 0x00000004 // Error +#define USB_RXCSRL2_OVER 0x00000004 // Overrun +#define USB_RXCSRL2_FULL 0x00000002 // FIFO Full +#define USB_RXCSRL2_RXRDY 0x00000001 // Receive Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRH2 register. +// +//***************************************************************************** +#define USB_RXCSRH2_AUTOCL 0x00000080 // Auto Clear +#define USB_RXCSRH2_AUTORQ 0x00000040 // Auto Request +#define USB_RXCSRH2_ISO 0x00000040 // Isochronous Transfers +#define USB_RXCSRH2_DMAEN 0x00000020 // DMA Request Enable +#define USB_RXCSRH2_DISNYET 0x00000010 // Disable NYET +#define USB_RXCSRH2_PIDERR 0x00000010 // PID Error +#define USB_RXCSRH2_DMAMOD 0x00000008 // DMA Request Mode +#define USB_RXCSRH2_DTWE 0x00000004 // Data Toggle Write Enable +#define USB_RXCSRH2_DT 0x00000002 // Data Toggle +#define USB_RXCSRH2_INCOMPRX 0x00000001 // Incomplete RX Transmission + // Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCOUNT2 register. +// +//***************************************************************************** +#define USB_RXCOUNT2_COUNT_M 0x00001FFF // Receive Packet Count +#define USB_RXCOUNT2_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXTYPE2 register. +// +//***************************************************************************** +#define USB_TXTYPE2_SPEED_M 0x000000C0 // Operating Speed +#define USB_TXTYPE2_SPEED_DFLT 0x00000000 // Default +#define USB_TXTYPE2_SPEED_HIGH 0x00000040 // High +#define USB_TXTYPE2_SPEED_FULL 0x00000080 // Full +#define USB_TXTYPE2_SPEED_LOW 0x000000C0 // Low +#define USB_TXTYPE2_PROTO_M 0x00000030 // Protocol +#define USB_TXTYPE2_PROTO_CTRL 0x00000000 // Control +#define USB_TXTYPE2_PROTO_ISOC 0x00000010 // Isochronous +#define USB_TXTYPE2_PROTO_BULK 0x00000020 // Bulk +#define USB_TXTYPE2_PROTO_INT 0x00000030 // Interrupt +#define USB_TXTYPE2_TEP_M 0x0000000F // Target Endpoint Number +#define USB_TXTYPE2_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXINTERVAL2 +// register. +// +//***************************************************************************** +#define USB_TXINTERVAL2_TXPOLL_M \ + 0x000000FF // TX Polling +#define USB_TXINTERVAL2_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_TXINTERVAL2_NAKLMT_S \ + 0 +#define USB_TXINTERVAL2_TXPOLL_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXTYPE2 register. +// +//***************************************************************************** +#define USB_RXTYPE2_SPEED_M 0x000000C0 // Operating Speed +#define USB_RXTYPE2_SPEED_DFLT 0x00000000 // Default +#define USB_RXTYPE2_SPEED_HIGH 0x00000040 // High +#define USB_RXTYPE2_SPEED_FULL 0x00000080 // Full +#define USB_RXTYPE2_SPEED_LOW 0x000000C0 // Low +#define USB_RXTYPE2_PROTO_M 0x00000030 // Protocol +#define USB_RXTYPE2_PROTO_CTRL 0x00000000 // Control +#define USB_RXTYPE2_PROTO_ISOC 0x00000010 // Isochronous +#define USB_RXTYPE2_PROTO_BULK 0x00000020 // Bulk +#define USB_RXTYPE2_PROTO_INT 0x00000030 // Interrupt +#define USB_RXTYPE2_TEP_M 0x0000000F // Target Endpoint Number +#define USB_RXTYPE2_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXINTERVAL2 +// register. +// +//***************************************************************************** +#define USB_RXINTERVAL2_TXPOLL_M \ + 0x000000FF // RX Polling +#define USB_RXINTERVAL2_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_RXINTERVAL2_TXPOLL_S \ + 0 +#define USB_RXINTERVAL2_NAKLMT_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXMAXP3 register. +// +//***************************************************************************** +#define USB_TXMAXP3_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_TXMAXP3_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRL3 register. +// +//***************************************************************************** +#define USB_TXCSRL3_NAKTO 0x00000080 // NAK Timeout +#define USB_TXCSRL3_CLRDT 0x00000040 // Clear Data Toggle +#define USB_TXCSRL3_STALLED 0x00000020 // Endpoint Stalled +#define USB_TXCSRL3_SETUP 0x00000010 // Setup Packet +#define USB_TXCSRL3_STALL 0x00000010 // Send STALL +#define USB_TXCSRL3_FLUSH 0x00000008 // Flush FIFO +#define USB_TXCSRL3_ERROR 0x00000004 // Error +#define USB_TXCSRL3_UNDRN 0x00000004 // Underrun +#define USB_TXCSRL3_FIFONE 0x00000002 // FIFO Not Empty +#define USB_TXCSRL3_TXRDY 0x00000001 // Transmit Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRH3 register. +// +//***************************************************************************** +#define USB_TXCSRH3_AUTOSET 0x00000080 // Auto Set +#define USB_TXCSRH3_ISO 0x00000040 // Isochronous Transfers +#define USB_TXCSRH3_MODE 0x00000020 // Mode +#define USB_TXCSRH3_DMAEN 0x00000010 // DMA Request Enable +#define USB_TXCSRH3_FDT 0x00000008 // Force Data Toggle +#define USB_TXCSRH3_DMAMOD 0x00000004 // DMA Request Mode +#define USB_TXCSRH3_DTWE 0x00000002 // Data Toggle Write Enable +#define USB_TXCSRH3_DT 0x00000001 // Data Toggle + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXMAXP3 register. +// +//***************************************************************************** +#define USB_RXMAXP3_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_RXMAXP3_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRL3 register. +// +//***************************************************************************** +#define USB_RXCSRL3_CLRDT 0x00000080 // Clear Data Toggle +#define USB_RXCSRL3_STALLED 0x00000040 // Endpoint Stalled +#define USB_RXCSRL3_STALL 0x00000020 // Send STALL +#define USB_RXCSRL3_REQPKT 0x00000020 // Request Packet +#define USB_RXCSRL3_FLUSH 0x00000010 // Flush FIFO +#define USB_RXCSRL3_DATAERR 0x00000008 // Data Error +#define USB_RXCSRL3_NAKTO 0x00000008 // NAK Timeout +#define USB_RXCSRL3_ERROR 0x00000004 // Error +#define USB_RXCSRL3_OVER 0x00000004 // Overrun +#define USB_RXCSRL3_FULL 0x00000002 // FIFO Full +#define USB_RXCSRL3_RXRDY 0x00000001 // Receive Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRH3 register. +// +//***************************************************************************** +#define USB_RXCSRH3_AUTOCL 0x00000080 // Auto Clear +#define USB_RXCSRH3_AUTORQ 0x00000040 // Auto Request +#define USB_RXCSRH3_ISO 0x00000040 // Isochronous Transfers +#define USB_RXCSRH3_DMAEN 0x00000020 // DMA Request Enable +#define USB_RXCSRH3_DISNYET 0x00000010 // Disable NYET +#define USB_RXCSRH3_PIDERR 0x00000010 // PID Error +#define USB_RXCSRH3_DMAMOD 0x00000008 // DMA Request Mode +#define USB_RXCSRH3_DTWE 0x00000004 // Data Toggle Write Enable +#define USB_RXCSRH3_DT 0x00000002 // Data Toggle +#define USB_RXCSRH3_INCOMPRX 0x00000001 // Incomplete RX Transmission + // Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCOUNT3 register. +// +//***************************************************************************** +#define USB_RXCOUNT3_COUNT_M 0x00001FFF // Receive Packet Count +#define USB_RXCOUNT3_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXTYPE3 register. +// +//***************************************************************************** +#define USB_TXTYPE3_SPEED_M 0x000000C0 // Operating Speed +#define USB_TXTYPE3_SPEED_DFLT 0x00000000 // Default +#define USB_TXTYPE3_SPEED_HIGH 0x00000040 // High +#define USB_TXTYPE3_SPEED_FULL 0x00000080 // Full +#define USB_TXTYPE3_SPEED_LOW 0x000000C0 // Low +#define USB_TXTYPE3_PROTO_M 0x00000030 // Protocol +#define USB_TXTYPE3_PROTO_CTRL 0x00000000 // Control +#define USB_TXTYPE3_PROTO_ISOC 0x00000010 // Isochronous +#define USB_TXTYPE3_PROTO_BULK 0x00000020 // Bulk +#define USB_TXTYPE3_PROTO_INT 0x00000030 // Interrupt +#define USB_TXTYPE3_TEP_M 0x0000000F // Target Endpoint Number +#define USB_TXTYPE3_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXINTERVAL3 +// register. +// +//***************************************************************************** +#define USB_TXINTERVAL3_TXPOLL_M \ + 0x000000FF // TX Polling +#define USB_TXINTERVAL3_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_TXINTERVAL3_TXPOLL_S \ + 0 +#define USB_TXINTERVAL3_NAKLMT_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXTYPE3 register. +// +//***************************************************************************** +#define USB_RXTYPE3_SPEED_M 0x000000C0 // Operating Speed +#define USB_RXTYPE3_SPEED_DFLT 0x00000000 // Default +#define USB_RXTYPE3_SPEED_HIGH 0x00000040 // High +#define USB_RXTYPE3_SPEED_FULL 0x00000080 // Full +#define USB_RXTYPE3_SPEED_LOW 0x000000C0 // Low +#define USB_RXTYPE3_PROTO_M 0x00000030 // Protocol +#define USB_RXTYPE3_PROTO_CTRL 0x00000000 // Control +#define USB_RXTYPE3_PROTO_ISOC 0x00000010 // Isochronous +#define USB_RXTYPE3_PROTO_BULK 0x00000020 // Bulk +#define USB_RXTYPE3_PROTO_INT 0x00000030 // Interrupt +#define USB_RXTYPE3_TEP_M 0x0000000F // Target Endpoint Number +#define USB_RXTYPE3_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXINTERVAL3 +// register. +// +//***************************************************************************** +#define USB_RXINTERVAL3_TXPOLL_M \ + 0x000000FF // RX Polling +#define USB_RXINTERVAL3_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_RXINTERVAL3_TXPOLL_S \ + 0 +#define USB_RXINTERVAL3_NAKLMT_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXMAXP4 register. +// +//***************************************************************************** +#define USB_TXMAXP4_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_TXMAXP4_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRL4 register. +// +//***************************************************************************** +#define USB_TXCSRL4_NAKTO 0x00000080 // NAK Timeout +#define USB_TXCSRL4_CLRDT 0x00000040 // Clear Data Toggle +#define USB_TXCSRL4_STALLED 0x00000020 // Endpoint Stalled +#define USB_TXCSRL4_SETUP 0x00000010 // Setup Packet +#define USB_TXCSRL4_STALL 0x00000010 // Send STALL +#define USB_TXCSRL4_FLUSH 0x00000008 // Flush FIFO +#define USB_TXCSRL4_ERROR 0x00000004 // Error +#define USB_TXCSRL4_UNDRN 0x00000004 // Underrun +#define USB_TXCSRL4_FIFONE 0x00000002 // FIFO Not Empty +#define USB_TXCSRL4_TXRDY 0x00000001 // Transmit Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRH4 register. +// +//***************************************************************************** +#define USB_TXCSRH4_AUTOSET 0x00000080 // Auto Set +#define USB_TXCSRH4_ISO 0x00000040 // Isochronous Transfers +#define USB_TXCSRH4_MODE 0x00000020 // Mode +#define USB_TXCSRH4_DMAEN 0x00000010 // DMA Request Enable +#define USB_TXCSRH4_FDT 0x00000008 // Force Data Toggle +#define USB_TXCSRH4_DMAMOD 0x00000004 // DMA Request Mode +#define USB_TXCSRH4_DTWE 0x00000002 // Data Toggle Write Enable +#define USB_TXCSRH4_DT 0x00000001 // Data Toggle + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXMAXP4 register. +// +//***************************************************************************** +#define USB_RXMAXP4_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_RXMAXP4_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRL4 register. +// +//***************************************************************************** +#define USB_RXCSRL4_CLRDT 0x00000080 // Clear Data Toggle +#define USB_RXCSRL4_STALLED 0x00000040 // Endpoint Stalled +#define USB_RXCSRL4_STALL 0x00000020 // Send STALL +#define USB_RXCSRL4_REQPKT 0x00000020 // Request Packet +#define USB_RXCSRL4_FLUSH 0x00000010 // Flush FIFO +#define USB_RXCSRL4_NAKTO 0x00000008 // NAK Timeout +#define USB_RXCSRL4_DATAERR 0x00000008 // Data Error +#define USB_RXCSRL4_OVER 0x00000004 // Overrun +#define USB_RXCSRL4_ERROR 0x00000004 // Error +#define USB_RXCSRL4_FULL 0x00000002 // FIFO Full +#define USB_RXCSRL4_RXRDY 0x00000001 // Receive Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRH4 register. +// +//***************************************************************************** +#define USB_RXCSRH4_AUTOCL 0x00000080 // Auto Clear +#define USB_RXCSRH4_AUTORQ 0x00000040 // Auto Request +#define USB_RXCSRH4_ISO 0x00000040 // Isochronous Transfers +#define USB_RXCSRH4_DMAEN 0x00000020 // DMA Request Enable +#define USB_RXCSRH4_DISNYET 0x00000010 // Disable NYET +#define USB_RXCSRH4_PIDERR 0x00000010 // PID Error +#define USB_RXCSRH4_DMAMOD 0x00000008 // DMA Request Mode +#define USB_RXCSRH4_DTWE 0x00000004 // Data Toggle Write Enable +#define USB_RXCSRH4_DT 0x00000002 // Data Toggle +#define USB_RXCSRH4_INCOMPRX 0x00000001 // Incomplete RX Transmission + // Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCOUNT4 register. +// +//***************************************************************************** +#define USB_RXCOUNT4_COUNT_M 0x00001FFF // Receive Packet Count +#define USB_RXCOUNT4_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXTYPE4 register. +// +//***************************************************************************** +#define USB_TXTYPE4_SPEED_M 0x000000C0 // Operating Speed +#define USB_TXTYPE4_SPEED_DFLT 0x00000000 // Default +#define USB_TXTYPE4_SPEED_HIGH 0x00000040 // High +#define USB_TXTYPE4_SPEED_FULL 0x00000080 // Full +#define USB_TXTYPE4_SPEED_LOW 0x000000C0 // Low +#define USB_TXTYPE4_PROTO_M 0x00000030 // Protocol +#define USB_TXTYPE4_PROTO_CTRL 0x00000000 // Control +#define USB_TXTYPE4_PROTO_ISOC 0x00000010 // Isochronous +#define USB_TXTYPE4_PROTO_BULK 0x00000020 // Bulk +#define USB_TXTYPE4_PROTO_INT 0x00000030 // Interrupt +#define USB_TXTYPE4_TEP_M 0x0000000F // Target Endpoint Number +#define USB_TXTYPE4_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXINTERVAL4 +// register. +// +//***************************************************************************** +#define USB_TXINTERVAL4_TXPOLL_M \ + 0x000000FF // TX Polling +#define USB_TXINTERVAL4_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_TXINTERVAL4_NAKLMT_S \ + 0 +#define USB_TXINTERVAL4_TXPOLL_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXTYPE4 register. +// +//***************************************************************************** +#define USB_RXTYPE4_SPEED_M 0x000000C0 // Operating Speed +#define USB_RXTYPE4_SPEED_DFLT 0x00000000 // Default +#define USB_RXTYPE4_SPEED_HIGH 0x00000040 // High +#define USB_RXTYPE4_SPEED_FULL 0x00000080 // Full +#define USB_RXTYPE4_SPEED_LOW 0x000000C0 // Low +#define USB_RXTYPE4_PROTO_M 0x00000030 // Protocol +#define USB_RXTYPE4_PROTO_CTRL 0x00000000 // Control +#define USB_RXTYPE4_PROTO_ISOC 0x00000010 // Isochronous +#define USB_RXTYPE4_PROTO_BULK 0x00000020 // Bulk +#define USB_RXTYPE4_PROTO_INT 0x00000030 // Interrupt +#define USB_RXTYPE4_TEP_M 0x0000000F // Target Endpoint Number +#define USB_RXTYPE4_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXINTERVAL4 +// register. +// +//***************************************************************************** +#define USB_RXINTERVAL4_TXPOLL_M \ + 0x000000FF // RX Polling +#define USB_RXINTERVAL4_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_RXINTERVAL4_NAKLMT_S \ + 0 +#define USB_RXINTERVAL4_TXPOLL_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXMAXP5 register. +// +//***************************************************************************** +#define USB_TXMAXP5_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_TXMAXP5_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRL5 register. +// +//***************************************************************************** +#define USB_TXCSRL5_NAKTO 0x00000080 // NAK Timeout +#define USB_TXCSRL5_CLRDT 0x00000040 // Clear Data Toggle +#define USB_TXCSRL5_STALLED 0x00000020 // Endpoint Stalled +#define USB_TXCSRL5_SETUP 0x00000010 // Setup Packet +#define USB_TXCSRL5_STALL 0x00000010 // Send STALL +#define USB_TXCSRL5_FLUSH 0x00000008 // Flush FIFO +#define USB_TXCSRL5_ERROR 0x00000004 // Error +#define USB_TXCSRL5_UNDRN 0x00000004 // Underrun +#define USB_TXCSRL5_FIFONE 0x00000002 // FIFO Not Empty +#define USB_TXCSRL5_TXRDY 0x00000001 // Transmit Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRH5 register. +// +//***************************************************************************** +#define USB_TXCSRH5_AUTOSET 0x00000080 // Auto Set +#define USB_TXCSRH5_ISO 0x00000040 // Isochronous Transfers +#define USB_TXCSRH5_MODE 0x00000020 // Mode +#define USB_TXCSRH5_DMAEN 0x00000010 // DMA Request Enable +#define USB_TXCSRH5_FDT 0x00000008 // Force Data Toggle +#define USB_TXCSRH5_DMAMOD 0x00000004 // DMA Request Mode +#define USB_TXCSRH5_DTWE 0x00000002 // Data Toggle Write Enable +#define USB_TXCSRH5_DT 0x00000001 // Data Toggle + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXMAXP5 register. +// +//***************************************************************************** +#define USB_RXMAXP5_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_RXMAXP5_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRL5 register. +// +//***************************************************************************** +#define USB_RXCSRL5_CLRDT 0x00000080 // Clear Data Toggle +#define USB_RXCSRL5_STALLED 0x00000040 // Endpoint Stalled +#define USB_RXCSRL5_STALL 0x00000020 // Send STALL +#define USB_RXCSRL5_REQPKT 0x00000020 // Request Packet +#define USB_RXCSRL5_FLUSH 0x00000010 // Flush FIFO +#define USB_RXCSRL5_NAKTO 0x00000008 // NAK Timeout +#define USB_RXCSRL5_DATAERR 0x00000008 // Data Error +#define USB_RXCSRL5_ERROR 0x00000004 // Error +#define USB_RXCSRL5_OVER 0x00000004 // Overrun +#define USB_RXCSRL5_FULL 0x00000002 // FIFO Full +#define USB_RXCSRL5_RXRDY 0x00000001 // Receive Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRH5 register. +// +//***************************************************************************** +#define USB_RXCSRH5_AUTOCL 0x00000080 // Auto Clear +#define USB_RXCSRH5_AUTORQ 0x00000040 // Auto Request +#define USB_RXCSRH5_ISO 0x00000040 // Isochronous Transfers +#define USB_RXCSRH5_DMAEN 0x00000020 // DMA Request Enable +#define USB_RXCSRH5_DISNYET 0x00000010 // Disable NYET +#define USB_RXCSRH5_PIDERR 0x00000010 // PID Error +#define USB_RXCSRH5_DMAMOD 0x00000008 // DMA Request Mode +#define USB_RXCSRH5_DTWE 0x00000004 // Data Toggle Write Enable +#define USB_RXCSRH5_DT 0x00000002 // Data Toggle +#define USB_RXCSRH5_INCOMPRX 0x00000001 // Incomplete RX Transmission + // Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCOUNT5 register. +// +//***************************************************************************** +#define USB_RXCOUNT5_COUNT_M 0x00001FFF // Receive Packet Count +#define USB_RXCOUNT5_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXTYPE5 register. +// +//***************************************************************************** +#define USB_TXTYPE5_SPEED_M 0x000000C0 // Operating Speed +#define USB_TXTYPE5_SPEED_DFLT 0x00000000 // Default +#define USB_TXTYPE5_SPEED_HIGH 0x00000040 // High +#define USB_TXTYPE5_SPEED_FULL 0x00000080 // Full +#define USB_TXTYPE5_SPEED_LOW 0x000000C0 // Low +#define USB_TXTYPE5_PROTO_M 0x00000030 // Protocol +#define USB_TXTYPE5_PROTO_CTRL 0x00000000 // Control +#define USB_TXTYPE5_PROTO_ISOC 0x00000010 // Isochronous +#define USB_TXTYPE5_PROTO_BULK 0x00000020 // Bulk +#define USB_TXTYPE5_PROTO_INT 0x00000030 // Interrupt +#define USB_TXTYPE5_TEP_M 0x0000000F // Target Endpoint Number +#define USB_TXTYPE5_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXINTERVAL5 +// register. +// +//***************************************************************************** +#define USB_TXINTERVAL5_TXPOLL_M \ + 0x000000FF // TX Polling +#define USB_TXINTERVAL5_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_TXINTERVAL5_NAKLMT_S \ + 0 +#define USB_TXINTERVAL5_TXPOLL_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXTYPE5 register. +// +//***************************************************************************** +#define USB_RXTYPE5_SPEED_M 0x000000C0 // Operating Speed +#define USB_RXTYPE5_SPEED_DFLT 0x00000000 // Default +#define USB_RXTYPE5_SPEED_HIGH 0x00000040 // High +#define USB_RXTYPE5_SPEED_FULL 0x00000080 // Full +#define USB_RXTYPE5_SPEED_LOW 0x000000C0 // Low +#define USB_RXTYPE5_PROTO_M 0x00000030 // Protocol +#define USB_RXTYPE5_PROTO_CTRL 0x00000000 // Control +#define USB_RXTYPE5_PROTO_ISOC 0x00000010 // Isochronous +#define USB_RXTYPE5_PROTO_BULK 0x00000020 // Bulk +#define USB_RXTYPE5_PROTO_INT 0x00000030 // Interrupt +#define USB_RXTYPE5_TEP_M 0x0000000F // Target Endpoint Number +#define USB_RXTYPE5_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXINTERVAL5 +// register. +// +//***************************************************************************** +#define USB_RXINTERVAL5_TXPOLL_M \ + 0x000000FF // RX Polling +#define USB_RXINTERVAL5_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_RXINTERVAL5_TXPOLL_S \ + 0 +#define USB_RXINTERVAL5_NAKLMT_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXMAXP6 register. +// +//***************************************************************************** +#define USB_TXMAXP6_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_TXMAXP6_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRL6 register. +// +//***************************************************************************** +#define USB_TXCSRL6_NAKTO 0x00000080 // NAK Timeout +#define USB_TXCSRL6_CLRDT 0x00000040 // Clear Data Toggle +#define USB_TXCSRL6_STALLED 0x00000020 // Endpoint Stalled +#define USB_TXCSRL6_STALL 0x00000010 // Send STALL +#define USB_TXCSRL6_SETUP 0x00000010 // Setup Packet +#define USB_TXCSRL6_FLUSH 0x00000008 // Flush FIFO +#define USB_TXCSRL6_ERROR 0x00000004 // Error +#define USB_TXCSRL6_UNDRN 0x00000004 // Underrun +#define USB_TXCSRL6_FIFONE 0x00000002 // FIFO Not Empty +#define USB_TXCSRL6_TXRDY 0x00000001 // Transmit Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRH6 register. +// +//***************************************************************************** +#define USB_TXCSRH6_AUTOSET 0x00000080 // Auto Set +#define USB_TXCSRH6_ISO 0x00000040 // Isochronous Transfers +#define USB_TXCSRH6_MODE 0x00000020 // Mode +#define USB_TXCSRH6_DMAEN 0x00000010 // DMA Request Enable +#define USB_TXCSRH6_FDT 0x00000008 // Force Data Toggle +#define USB_TXCSRH6_DMAMOD 0x00000004 // DMA Request Mode +#define USB_TXCSRH6_DTWE 0x00000002 // Data Toggle Write Enable +#define USB_TXCSRH6_DT 0x00000001 // Data Toggle + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXMAXP6 register. +// +//***************************************************************************** +#define USB_RXMAXP6_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_RXMAXP6_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRL6 register. +// +//***************************************************************************** +#define USB_RXCSRL6_CLRDT 0x00000080 // Clear Data Toggle +#define USB_RXCSRL6_STALLED 0x00000040 // Endpoint Stalled +#define USB_RXCSRL6_REQPKT 0x00000020 // Request Packet +#define USB_RXCSRL6_STALL 0x00000020 // Send STALL +#define USB_RXCSRL6_FLUSH 0x00000010 // Flush FIFO +#define USB_RXCSRL6_NAKTO 0x00000008 // NAK Timeout +#define USB_RXCSRL6_DATAERR 0x00000008 // Data Error +#define USB_RXCSRL6_ERROR 0x00000004 // Error +#define USB_RXCSRL6_OVER 0x00000004 // Overrun +#define USB_RXCSRL6_FULL 0x00000002 // FIFO Full +#define USB_RXCSRL6_RXRDY 0x00000001 // Receive Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRH6 register. +// +//***************************************************************************** +#define USB_RXCSRH6_AUTOCL 0x00000080 // Auto Clear +#define USB_RXCSRH6_AUTORQ 0x00000040 // Auto Request +#define USB_RXCSRH6_ISO 0x00000040 // Isochronous Transfers +#define USB_RXCSRH6_DMAEN 0x00000020 // DMA Request Enable +#define USB_RXCSRH6_DISNYET 0x00000010 // Disable NYET +#define USB_RXCSRH6_PIDERR 0x00000010 // PID Error +#define USB_RXCSRH6_DMAMOD 0x00000008 // DMA Request Mode +#define USB_RXCSRH6_DTWE 0x00000004 // Data Toggle Write Enable +#define USB_RXCSRH6_DT 0x00000002 // Data Toggle +#define USB_RXCSRH6_INCOMPRX 0x00000001 // Incomplete RX Transmission + // Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCOUNT6 register. +// +//***************************************************************************** +#define USB_RXCOUNT6_COUNT_M 0x00001FFF // Receive Packet Count +#define USB_RXCOUNT6_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXTYPE6 register. +// +//***************************************************************************** +#define USB_TXTYPE6_SPEED_M 0x000000C0 // Operating Speed +#define USB_TXTYPE6_SPEED_DFLT 0x00000000 // Default +#define USB_TXTYPE6_SPEED_HIGH 0x00000040 // High +#define USB_TXTYPE6_SPEED_FULL 0x00000080 // Full +#define USB_TXTYPE6_SPEED_LOW 0x000000C0 // Low +#define USB_TXTYPE6_PROTO_M 0x00000030 // Protocol +#define USB_TXTYPE6_PROTO_CTRL 0x00000000 // Control +#define USB_TXTYPE6_PROTO_ISOC 0x00000010 // Isochronous +#define USB_TXTYPE6_PROTO_BULK 0x00000020 // Bulk +#define USB_TXTYPE6_PROTO_INT 0x00000030 // Interrupt +#define USB_TXTYPE6_TEP_M 0x0000000F // Target Endpoint Number +#define USB_TXTYPE6_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXINTERVAL6 +// register. +// +//***************************************************************************** +#define USB_TXINTERVAL6_TXPOLL_M \ + 0x000000FF // TX Polling +#define USB_TXINTERVAL6_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_TXINTERVAL6_TXPOLL_S \ + 0 +#define USB_TXINTERVAL6_NAKLMT_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXTYPE6 register. +// +//***************************************************************************** +#define USB_RXTYPE6_SPEED_M 0x000000C0 // Operating Speed +#define USB_RXTYPE6_SPEED_DFLT 0x00000000 // Default +#define USB_RXTYPE6_SPEED_HIGH 0x00000040 // High +#define USB_RXTYPE6_SPEED_FULL 0x00000080 // Full +#define USB_RXTYPE6_SPEED_LOW 0x000000C0 // Low +#define USB_RXTYPE6_PROTO_M 0x00000030 // Protocol +#define USB_RXTYPE6_PROTO_CTRL 0x00000000 // Control +#define USB_RXTYPE6_PROTO_ISOC 0x00000010 // Isochronous +#define USB_RXTYPE6_PROTO_BULK 0x00000020 // Bulk +#define USB_RXTYPE6_PROTO_INT 0x00000030 // Interrupt +#define USB_RXTYPE6_TEP_M 0x0000000F // Target Endpoint Number +#define USB_RXTYPE6_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXINTERVAL6 +// register. +// +//***************************************************************************** +#define USB_RXINTERVAL6_TXPOLL_M \ + 0x000000FF // RX Polling +#define USB_RXINTERVAL6_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_RXINTERVAL6_NAKLMT_S \ + 0 +#define USB_RXINTERVAL6_TXPOLL_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXMAXP7 register. +// +//***************************************************************************** +#define USB_TXMAXP7_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_TXMAXP7_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRL7 register. +// +//***************************************************************************** +#define USB_TXCSRL7_NAKTO 0x00000080 // NAK Timeout +#define USB_TXCSRL7_CLRDT 0x00000040 // Clear Data Toggle +#define USB_TXCSRL7_STALLED 0x00000020 // Endpoint Stalled +#define USB_TXCSRL7_STALL 0x00000010 // Send STALL +#define USB_TXCSRL7_SETUP 0x00000010 // Setup Packet +#define USB_TXCSRL7_FLUSH 0x00000008 // Flush FIFO +#define USB_TXCSRL7_ERROR 0x00000004 // Error +#define USB_TXCSRL7_UNDRN 0x00000004 // Underrun +#define USB_TXCSRL7_FIFONE 0x00000002 // FIFO Not Empty +#define USB_TXCSRL7_TXRDY 0x00000001 // Transmit Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXCSRH7 register. +// +//***************************************************************************** +#define USB_TXCSRH7_AUTOSET 0x00000080 // Auto Set +#define USB_TXCSRH7_ISO 0x00000040 // Isochronous Transfers +#define USB_TXCSRH7_MODE 0x00000020 // Mode +#define USB_TXCSRH7_DMAEN 0x00000010 // DMA Request Enable +#define USB_TXCSRH7_FDT 0x00000008 // Force Data Toggle +#define USB_TXCSRH7_DMAMOD 0x00000004 // DMA Request Mode +#define USB_TXCSRH7_DTWE 0x00000002 // Data Toggle Write Enable +#define USB_TXCSRH7_DT 0x00000001 // Data Toggle + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXMAXP7 register. +// +//***************************************************************************** +#define USB_RXMAXP7_MAXLOAD_M 0x000007FF // Maximum Payload +#define USB_RXMAXP7_MAXLOAD_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRL7 register. +// +//***************************************************************************** +#define USB_RXCSRL7_CLRDT 0x00000080 // Clear Data Toggle +#define USB_RXCSRL7_STALLED 0x00000040 // Endpoint Stalled +#define USB_RXCSRL7_REQPKT 0x00000020 // Request Packet +#define USB_RXCSRL7_STALL 0x00000020 // Send STALL +#define USB_RXCSRL7_FLUSH 0x00000010 // Flush FIFO +#define USB_RXCSRL7_DATAERR 0x00000008 // Data Error +#define USB_RXCSRL7_NAKTO 0x00000008 // NAK Timeout +#define USB_RXCSRL7_ERROR 0x00000004 // Error +#define USB_RXCSRL7_OVER 0x00000004 // Overrun +#define USB_RXCSRL7_FULL 0x00000002 // FIFO Full +#define USB_RXCSRL7_RXRDY 0x00000001 // Receive Packet Ready + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCSRH7 register. +// +//***************************************************************************** +#define USB_RXCSRH7_AUTOCL 0x00000080 // Auto Clear +#define USB_RXCSRH7_ISO 0x00000040 // Isochronous Transfers +#define USB_RXCSRH7_AUTORQ 0x00000040 // Auto Request +#define USB_RXCSRH7_DMAEN 0x00000020 // DMA Request Enable +#define USB_RXCSRH7_PIDERR 0x00000010 // PID Error +#define USB_RXCSRH7_DISNYET 0x00000010 // Disable NYET +#define USB_RXCSRH7_DMAMOD 0x00000008 // DMA Request Mode +#define USB_RXCSRH7_DTWE 0x00000004 // Data Toggle Write Enable +#define USB_RXCSRH7_DT 0x00000002 // Data Toggle +#define USB_RXCSRH7_INCOMPRX 0x00000001 // Incomplete RX Transmission + // Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXCOUNT7 register. +// +//***************************************************************************** +#define USB_RXCOUNT7_COUNT_M 0x00001FFF // Receive Packet Count +#define USB_RXCOUNT7_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXTYPE7 register. +// +//***************************************************************************** +#define USB_TXTYPE7_SPEED_M 0x000000C0 // Operating Speed +#define USB_TXTYPE7_SPEED_DFLT 0x00000000 // Default +#define USB_TXTYPE7_SPEED_HIGH 0x00000040 // High +#define USB_TXTYPE7_SPEED_FULL 0x00000080 // Full +#define USB_TXTYPE7_SPEED_LOW 0x000000C0 // Low +#define USB_TXTYPE7_PROTO_M 0x00000030 // Protocol +#define USB_TXTYPE7_PROTO_CTRL 0x00000000 // Control +#define USB_TXTYPE7_PROTO_ISOC 0x00000010 // Isochronous +#define USB_TXTYPE7_PROTO_BULK 0x00000020 // Bulk +#define USB_TXTYPE7_PROTO_INT 0x00000030 // Interrupt +#define USB_TXTYPE7_TEP_M 0x0000000F // Target Endpoint Number +#define USB_TXTYPE7_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXINTERVAL7 +// register. +// +//***************************************************************************** +#define USB_TXINTERVAL7_TXPOLL_M \ + 0x000000FF // TX Polling +#define USB_TXINTERVAL7_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_TXINTERVAL7_NAKLMT_S \ + 0 +#define USB_TXINTERVAL7_TXPOLL_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXTYPE7 register. +// +//***************************************************************************** +#define USB_RXTYPE7_SPEED_M 0x000000C0 // Operating Speed +#define USB_RXTYPE7_SPEED_DFLT 0x00000000 // Default +#define USB_RXTYPE7_SPEED_HIGH 0x00000040 // High +#define USB_RXTYPE7_SPEED_FULL 0x00000080 // Full +#define USB_RXTYPE7_SPEED_LOW 0x000000C0 // Low +#define USB_RXTYPE7_PROTO_M 0x00000030 // Protocol +#define USB_RXTYPE7_PROTO_CTRL 0x00000000 // Control +#define USB_RXTYPE7_PROTO_ISOC 0x00000010 // Isochronous +#define USB_RXTYPE7_PROTO_BULK 0x00000020 // Bulk +#define USB_RXTYPE7_PROTO_INT 0x00000030 // Interrupt +#define USB_RXTYPE7_TEP_M 0x0000000F // Target Endpoint Number +#define USB_RXTYPE7_TEP_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXINTERVAL7 +// register. +// +//***************************************************************************** +#define USB_RXINTERVAL7_TXPOLL_M \ + 0x000000FF // RX Polling +#define USB_RXINTERVAL7_NAKLMT_M \ + 0x000000FF // NAK Limit +#define USB_RXINTERVAL7_NAKLMT_S \ + 0 +#define USB_RXINTERVAL7_TXPOLL_S \ + 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMAINTR register. +// +//***************************************************************************** +#define USB_DMAINTR_CH7 0x00000080 // Channel 7 DMA Interrupt +#define USB_DMAINTR_CH6 0x00000040 // Channel 6 DMA Interrupt +#define USB_DMAINTR_CH5 0x00000020 // Channel 5 DMA Interrupt +#define USB_DMAINTR_CH4 0x00000010 // Channel 4 DMA Interrupt +#define USB_DMAINTR_CH3 0x00000008 // Channel 3 DMA Interrupt +#define USB_DMAINTR_CH2 0x00000004 // Channel 2 DMA Interrupt +#define USB_DMAINTR_CH1 0x00000002 // Channel 1 DMA Interrupt +#define USB_DMAINTR_CH0 0x00000001 // Channel 0 DMA Interrupt + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACTL0 register. +// +//***************************************************************************** +#define USB_DMACTL0_BRSTM_M 0x00000600 // Burst Mode +#define USB_DMACTL0_BRSTM_ANY 0x00000000 // Bursts of unspecified length +#define USB_DMACTL0_BRSTM_INC4 0x00000200 // INCR4 or unspecified length +#define USB_DMACTL0_BRSTM_INC8 0x00000400 // INCR8, INCR4 or unspecified + // length +#define USB_DMACTL0_BRSTM_INC16 0x00000600 // INCR16, INCR8, INCR4 or + // unspecified length +#define USB_DMACTL0_ERR 0x00000100 // Bus Error Bit +#define USB_DMACTL0_EP_M 0x000000F0 // Endpoint number +#define USB_DMACTL0_IE 0x00000008 // DMA Interrupt Enable +#define USB_DMACTL0_MODE 0x00000004 // DMA Transfer Mode +#define USB_DMACTL0_DIR 0x00000002 // DMA Direction +#define USB_DMACTL0_ENABLE 0x00000001 // DMA Transfer Enable +#define USB_DMACTL0_EP_S 4 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMAADDR0 register. +// +//***************************************************************************** +#define USB_DMAADDR0_ADDR_M 0xFFFFFFFC // DMA Address +#define USB_DMAADDR0_ADDR_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACOUNT0 +// register. +// +//***************************************************************************** +#define USB_DMACOUNT0_COUNT_M 0xFFFFFFFC // DMA Count +#define USB_DMACOUNT0_COUNT_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACTL1 register. +// +//***************************************************************************** +#define USB_DMACTL1_BRSTM_M 0x00000600 // Burst Mode +#define USB_DMACTL1_BRSTM_ANY 0x00000000 // Bursts of unspecified length +#define USB_DMACTL1_BRSTM_INC4 0x00000200 // INCR4 or unspecified length +#define USB_DMACTL1_BRSTM_INC8 0x00000400 // INCR8, INCR4 or unspecified + // length +#define USB_DMACTL1_BRSTM_INC16 0x00000600 // INCR16, INCR8, INCR4 or + // unspecified length +#define USB_DMACTL1_ERR 0x00000100 // Bus Error Bit +#define USB_DMACTL1_EP_M 0x000000F0 // Endpoint number +#define USB_DMACTL1_IE 0x00000008 // DMA Interrupt Enable +#define USB_DMACTL1_MODE 0x00000004 // DMA Transfer Mode +#define USB_DMACTL1_DIR 0x00000002 // DMA Direction +#define USB_DMACTL1_ENABLE 0x00000001 // DMA Transfer Enable +#define USB_DMACTL1_EP_S 4 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMAADDR1 register. +// +//***************************************************************************** +#define USB_DMAADDR1_ADDR_M 0xFFFFFFFC // DMA Address +#define USB_DMAADDR1_ADDR_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACOUNT1 +// register. +// +//***************************************************************************** +#define USB_DMACOUNT1_COUNT_M 0xFFFFFFFC // DMA Count +#define USB_DMACOUNT1_COUNT_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACTL2 register. +// +//***************************************************************************** +#define USB_DMACTL2_BRSTM_M 0x00000600 // Burst Mode +#define USB_DMACTL2_BRSTM_ANY 0x00000000 // Bursts of unspecified length +#define USB_DMACTL2_BRSTM_INC4 0x00000200 // INCR4 or unspecified length +#define USB_DMACTL2_BRSTM_INC8 0x00000400 // INCR8, INCR4 or unspecified + // length +#define USB_DMACTL2_BRSTM_INC16 0x00000600 // INCR16, INCR8, INCR4 or + // unspecified length +#define USB_DMACTL2_ERR 0x00000100 // Bus Error Bit +#define USB_DMACTL2_EP_M 0x000000F0 // Endpoint number +#define USB_DMACTL2_IE 0x00000008 // DMA Interrupt Enable +#define USB_DMACTL2_MODE 0x00000004 // DMA Transfer Mode +#define USB_DMACTL2_DIR 0x00000002 // DMA Direction +#define USB_DMACTL2_ENABLE 0x00000001 // DMA Transfer Enable +#define USB_DMACTL2_EP_S 4 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMAADDR2 register. +// +//***************************************************************************** +#define USB_DMAADDR2_ADDR_M 0xFFFFFFFC // DMA Address +#define USB_DMAADDR2_ADDR_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACOUNT2 +// register. +// +//***************************************************************************** +#define USB_DMACOUNT2_COUNT_M 0xFFFFFFFC // DMA Count +#define USB_DMACOUNT2_COUNT_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACTL3 register. +// +//***************************************************************************** +#define USB_DMACTL3_BRSTM_M 0x00000600 // Burst Mode +#define USB_DMACTL3_BRSTM_ANY 0x00000000 // Bursts of unspecified length +#define USB_DMACTL3_BRSTM_INC4 0x00000200 // INCR4 or unspecified length +#define USB_DMACTL3_BRSTM_INC8 0x00000400 // INCR8, INCR4 or unspecified + // length +#define USB_DMACTL3_BRSTM_INC16 0x00000600 // INCR16, INCR8, INCR4 or + // unspecified length +#define USB_DMACTL3_ERR 0x00000100 // Bus Error Bit +#define USB_DMACTL3_EP_M 0x000000F0 // Endpoint number +#define USB_DMACTL3_IE 0x00000008 // DMA Interrupt Enable +#define USB_DMACTL3_MODE 0x00000004 // DMA Transfer Mode +#define USB_DMACTL3_DIR 0x00000002 // DMA Direction +#define USB_DMACTL3_ENABLE 0x00000001 // DMA Transfer Enable +#define USB_DMACTL3_EP_S 4 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMAADDR3 register. +// +//***************************************************************************** +#define USB_DMAADDR3_ADDR_M 0xFFFFFFFC // DMA Address +#define USB_DMAADDR3_ADDR_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACOUNT3 +// register. +// +//***************************************************************************** +#define USB_DMACOUNT3_COUNT_M 0xFFFFFFFC // DMA Count +#define USB_DMACOUNT3_COUNT_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACTL4 register. +// +//***************************************************************************** +#define USB_DMACTL4_BRSTM_M 0x00000600 // Burst Mode +#define USB_DMACTL4_BRSTM_ANY 0x00000000 // Bursts of unspecified length +#define USB_DMACTL4_BRSTM_INC4 0x00000200 // INCR4 or unspecified length +#define USB_DMACTL4_BRSTM_INC8 0x00000400 // INCR8, INCR4 or unspecified + // length +#define USB_DMACTL4_BRSTM_INC16 0x00000600 // INCR16, INCR8, INCR4 or + // unspecified length +#define USB_DMACTL4_ERR 0x00000100 // Bus Error Bit +#define USB_DMACTL4_EP_M 0x000000F0 // Endpoint number +#define USB_DMACTL4_IE 0x00000008 // DMA Interrupt Enable +#define USB_DMACTL4_MODE 0x00000004 // DMA Transfer Mode +#define USB_DMACTL4_DIR 0x00000002 // DMA Direction +#define USB_DMACTL4_ENABLE 0x00000001 // DMA Transfer Enable +#define USB_DMACTL4_EP_S 4 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMAADDR4 register. +// +//***************************************************************************** +#define USB_DMAADDR4_ADDR_M 0xFFFFFFFC // DMA Address +#define USB_DMAADDR4_ADDR_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACOUNT4 +// register. +// +//***************************************************************************** +#define USB_DMACOUNT4_COUNT_M 0xFFFFFFFC // DMA Count +#define USB_DMACOUNT4_COUNT_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACTL5 register. +// +//***************************************************************************** +#define USB_DMACTL5_BRSTM_M 0x00000600 // Burst Mode +#define USB_DMACTL5_BRSTM_ANY 0x00000000 // Bursts of unspecified length +#define USB_DMACTL5_BRSTM_INC4 0x00000200 // INCR4 or unspecified length +#define USB_DMACTL5_BRSTM_INC8 0x00000400 // INCR8, INCR4 or unspecified + // length +#define USB_DMACTL5_BRSTM_INC16 0x00000600 // INCR16, INCR8, INCR4 or + // unspecified length +#define USB_DMACTL5_ERR 0x00000100 // Bus Error Bit +#define USB_DMACTL5_EP_M 0x000000F0 // Endpoint number +#define USB_DMACTL5_IE 0x00000008 // DMA Interrupt Enable +#define USB_DMACTL5_MODE 0x00000004 // DMA Transfer Mode +#define USB_DMACTL5_DIR 0x00000002 // DMA Direction +#define USB_DMACTL5_ENABLE 0x00000001 // DMA Transfer Enable +#define USB_DMACTL5_EP_S 4 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMAADDR5 register. +// +//***************************************************************************** +#define USB_DMAADDR5_ADDR_M 0xFFFFFFFC // DMA Address +#define USB_DMAADDR5_ADDR_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACOUNT5 +// register. +// +//***************************************************************************** +#define USB_DMACOUNT5_COUNT_M 0xFFFFFFFC // DMA Count +#define USB_DMACOUNT5_COUNT_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACTL6 register. +// +//***************************************************************************** +#define USB_DMACTL6_BRSTM_M 0x00000600 // Burst Mode +#define USB_DMACTL6_BRSTM_ANY 0x00000000 // Bursts of unspecified length +#define USB_DMACTL6_BRSTM_INC4 0x00000200 // INCR4 or unspecified length +#define USB_DMACTL6_BRSTM_INC8 0x00000400 // INCR8, INCR4 or unspecified + // length +#define USB_DMACTL6_BRSTM_INC16 0x00000600 // INCR16, INCR8, INCR4 or + // unspecified length +#define USB_DMACTL6_ERR 0x00000100 // Bus Error Bit +#define USB_DMACTL6_EP_M 0x000000F0 // Endpoint number +#define USB_DMACTL6_IE 0x00000008 // DMA Interrupt Enable +#define USB_DMACTL6_MODE 0x00000004 // DMA Transfer Mode +#define USB_DMACTL6_DIR 0x00000002 // DMA Direction +#define USB_DMACTL6_ENABLE 0x00000001 // DMA Transfer Enable +#define USB_DMACTL6_EP_S 4 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMAADDR6 register. +// +//***************************************************************************** +#define USB_DMAADDR6_ADDR_M 0xFFFFFFFC // DMA Address +#define USB_DMAADDR6_ADDR_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACOUNT6 +// register. +// +//***************************************************************************** +#define USB_DMACOUNT6_COUNT_M 0xFFFFFFFC // DMA Count +#define USB_DMACOUNT6_COUNT_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACTL7 register. +// +//***************************************************************************** +#define USB_DMACTL7_BRSTM_M 0x00000600 // Burst Mode +#define USB_DMACTL7_BRSTM_ANY 0x00000000 // Bursts of unspecified length +#define USB_DMACTL7_BRSTM_INC4 0x00000200 // INCR4 or unspecified length +#define USB_DMACTL7_BRSTM_INC8 0x00000400 // INCR8, INCR4 or unspecified + // length +#define USB_DMACTL7_BRSTM_INC16 0x00000600 // INCR16, INCR8, INCR4 or + // unspecified length +#define USB_DMACTL7_ERR 0x00000100 // Bus Error Bit +#define USB_DMACTL7_EP_M 0x000000F0 // Endpoint number +#define USB_DMACTL7_IE 0x00000008 // DMA Interrupt Enable +#define USB_DMACTL7_MODE 0x00000004 // DMA Transfer Mode +#define USB_DMACTL7_DIR 0x00000002 // DMA Direction +#define USB_DMACTL7_ENABLE 0x00000001 // DMA Transfer Enable +#define USB_DMACTL7_EP_S 4 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMAADDR7 register. +// +//***************************************************************************** +#define USB_DMAADDR7_ADDR_M 0xFFFFFFFC // DMA Address +#define USB_DMAADDR7_ADDR_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DMACOUNT7 +// register. +// +//***************************************************************************** +#define USB_DMACOUNT7_COUNT_M 0xFFFFFFFC // DMA Count +#define USB_DMACOUNT7_COUNT_S 2 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RQPKTCOUNT1 +// register. +// +//***************************************************************************** +#define USB_RQPKTCOUNT1_M 0x0000FFFF // Block Transfer Packet Count +#define USB_RQPKTCOUNT1_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RQPKTCOUNT2 +// register. +// +//***************************************************************************** +#define USB_RQPKTCOUNT2_M 0x0000FFFF // Block Transfer Packet Count +#define USB_RQPKTCOUNT2_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RQPKTCOUNT3 +// register. +// +//***************************************************************************** +#define USB_RQPKTCOUNT3_M 0x0000FFFF // Block Transfer Packet Count +#define USB_RQPKTCOUNT3_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RQPKTCOUNT4 +// register. +// +//***************************************************************************** +#define USB_RQPKTCOUNT4_COUNT_M 0x0000FFFF // Block Transfer Packet Count +#define USB_RQPKTCOUNT4_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RQPKTCOUNT5 +// register. +// +//***************************************************************************** +#define USB_RQPKTCOUNT5_COUNT_M 0x0000FFFF // Block Transfer Packet Count +#define USB_RQPKTCOUNT5_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RQPKTCOUNT6 +// register. +// +//***************************************************************************** +#define USB_RQPKTCOUNT6_COUNT_M 0x0000FFFF // Block Transfer Packet Count +#define USB_RQPKTCOUNT6_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RQPKTCOUNT7 +// register. +// +//***************************************************************************** +#define USB_RQPKTCOUNT7_COUNT_M 0x0000FFFF // Block Transfer Packet Count +#define USB_RQPKTCOUNT7_COUNT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_RXDPKTBUFDIS +// register. +// +//***************************************************************************** +#define USB_RXDPKTBUFDIS_EP7 0x00000080 // EP7 RX Double-Packet Buffer + // Disable +#define USB_RXDPKTBUFDIS_EP6 0x00000040 // EP6 RX Double-Packet Buffer + // Disable +#define USB_RXDPKTBUFDIS_EP5 0x00000020 // EP5 RX Double-Packet Buffer + // Disable +#define USB_RXDPKTBUFDIS_EP4 0x00000010 // EP4 RX Double-Packet Buffer + // Disable +#define USB_RXDPKTBUFDIS_EP3 0x00000008 // EP3 RX Double-Packet Buffer + // Disable +#define USB_RXDPKTBUFDIS_EP2 0x00000004 // EP2 RX Double-Packet Buffer + // Disable +#define USB_RXDPKTBUFDIS_EP1 0x00000002 // EP1 RX Double-Packet Buffer + // Disable + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_TXDPKTBUFDIS +// register. +// +//***************************************************************************** +#define USB_TXDPKTBUFDIS_EP7 0x00000080 // EP7 TX Double-Packet Buffer + // Disable +#define USB_TXDPKTBUFDIS_EP6 0x00000040 // EP6 TX Double-Packet Buffer + // Disable +#define USB_TXDPKTBUFDIS_EP5 0x00000020 // EP5 TX Double-Packet Buffer + // Disable +#define USB_TXDPKTBUFDIS_EP4 0x00000010 // EP4 TX Double-Packet Buffer + // Disable +#define USB_TXDPKTBUFDIS_EP3 0x00000008 // EP3 TX Double-Packet Buffer + // Disable +#define USB_TXDPKTBUFDIS_EP2 0x00000004 // EP2 TX Double-Packet Buffer + // Disable +#define USB_TXDPKTBUFDIS_EP1 0x00000002 // EP1 TX Double-Packet Buffer + // Disable + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_CTO register. +// +//***************************************************************************** +#define USB_CTO_CCTV_M 0x0000FFFF // Configurable Chirp Timeout Value +#define USB_CTO_CCTV_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_HHSRTN register. +// +//***************************************************************************** +#define USB_HHSRTN_HHSRTN_M 0x0000FFFF // HIgh Speed to UTM Operating + // Delay +#define USB_HHSRTN_HHSRTN_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_HSBT register. +// +//***************************************************************************** +#define USB_HSBT_HSBT_M 0x0000000F // High Speed Timeout Adder +#define USB_HSBT_HSBT_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_LPMATTR register. +// +//***************************************************************************** +#define USB_LPMATTR_ENDPT_M 0x0000F000 // Endpoint +#define USB_LPMATTR_RMTWAK 0x00000100 // Remote Wake +#define USB_LPMATTR_HIRD_M 0x000000F0 // Host Initiated Resume Duration +#define USB_LPMATTR_LS_M 0x0000000F // Link State +#define USB_LPMATTR_LS_L1 0x00000001 // Sleep State (L1) +#define USB_LPMATTR_ENDPT_S 12 +#define USB_LPMATTR_HIRD_S 4 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_LPMCNTRL register. +// +//***************************************************************************** +#define USB_LPMCNTRL_NAK 0x00000010 // LPM NAK +#define USB_LPMCNTRL_EN_M 0x0000000C // LPM Enable +#define USB_LPMCNTRL_EN_NONE 0x00000000 // LPM and Extended transactions + // are not supported. In this case, + // the USB does not respond to LPM + // transactions and LPM + // transactions cause a timeout +#define USB_LPMCNTRL_EN_EXT 0x00000004 // LPM is not supported but + // extended transactions are + // supported. In this case, the USB + // does respond to an LPM + // transaction with a STALL +#define USB_LPMCNTRL_EN_LPMEXT 0x0000000C // The USB supports LPM extended + // transactions. In this case, the + // USB responds with a NYET or an + // ACK as determined by the value + // of TXLPM and other conditions +#define USB_LPMCNTRL_RES 0x00000002 // LPM Resume +#define USB_LPMCNTRL_TXLPM 0x00000001 // Transmit LPM Transaction Enable + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_LPMIM register. +// +//***************************************************************************** +#define USB_LPMIM_ERR 0x00000020 // LPM Error Interrupt Mask +#define USB_LPMIM_RES 0x00000010 // LPM Resume Interrupt Mask +#define USB_LPMIM_NC 0x00000008 // LPM NC Interrupt Mask +#define USB_LPMIM_ACK 0x00000004 // LPM ACK Interrupt Mask +#define USB_LPMIM_NY 0x00000002 // LPM NY Interrupt Mask +#define USB_LPMIM_STALL 0x00000001 // LPM STALL Interrupt Mask + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_LPMRIS register. +// +//***************************************************************************** +#define USB_LPMRIS_ERR 0x00000020 // LPM Interrupt Status +#define USB_LPMRIS_RES 0x00000010 // LPM Resume Interrupt Status +#define USB_LPMRIS_NC 0x00000008 // LPM NC Interrupt Status +#define USB_LPMRIS_ACK 0x00000004 // LPM ACK Interrupt Status +#define USB_LPMRIS_NY 0x00000002 // LPM NY Interrupt Status +#define USB_LPMRIS_LPMST 0x00000001 // LPM STALL Interrupt Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_LPMFADDR register. +// +//***************************************************************************** +#define USB_LPMFADDR_ADDR_M 0x0000007F // LPM Function Address +#define USB_LPMFADDR_ADDR_S 0 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_EPC register. +// +//***************************************************************************** +#define USB_EPC_PFLTACT_M 0x00000300 // Power Fault Action +#define USB_EPC_PFLTACT_UNCHG 0x00000000 // Unchanged +#define USB_EPC_PFLTACT_TRIS 0x00000100 // Tristate +#define USB_EPC_PFLTACT_LOW 0x00000200 // Low +#define USB_EPC_PFLTACT_HIGH 0x00000300 // High +#define USB_EPC_PFLTAEN 0x00000040 // Power Fault Action Enable +#define USB_EPC_PFLTSEN_HIGH 0x00000020 // Power Fault Sense +#define USB_EPC_PFLTEN 0x00000010 // Power Fault Input Enable +#define USB_EPC_EPENDE 0x00000004 // EPEN Drive Enable +#define USB_EPC_EPEN_M 0x00000003 // External Power Supply Enable + // Configuration +#define USB_EPC_EPEN_LOW 0x00000000 // Power Enable Active Low +#define USB_EPC_EPEN_HIGH 0x00000001 // Power Enable Active High +#define USB_EPC_EPEN_VBLOW 0x00000002 // Power Enable High if VBUS Low + // (OTG only) +#define USB_EPC_EPEN_VBHIGH 0x00000003 // Power Enable High if VBUS High + // (OTG only) + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_EPCRIS register. +// +//***************************************************************************** +#define USB_EPCRIS_PF 0x00000001 // USB Power Fault Interrupt Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_EPCIM register. +// +//***************************************************************************** +#define USB_EPCIM_PF 0x00000001 // USB Power Fault Interrupt Mask + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_EPCISC register. +// +//***************************************************************************** +#define USB_EPCISC_PF 0x00000001 // USB Power Fault Interrupt Status + // and Clear + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DRRIS register. +// +//***************************************************************************** +#define USB_DRRIS_RESUME 0x00000001 // RESUME Interrupt Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DRIM register. +// +//***************************************************************************** +#define USB_DRIM_RESUME 0x00000001 // RESUME Interrupt Mask + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_DRISC register. +// +//***************************************************************************** +#define USB_DRISC_RESUME 0x00000001 // RESUME Interrupt Status and + // Clear + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_GPCS register. +// +//***************************************************************************** +#define USB_GPCS_DEVMOD_M 0x00000007 // Device Mode +#define USB_GPCS_DEVMOD_OTG 0x00000000 // Use USB0VBUS and USB0ID pin +#define USB_GPCS_DEVMOD_HOST 0x00000002 // Force USB0VBUS and USB0ID low +#define USB_GPCS_DEVMOD_DEV 0x00000003 // Force USB0VBUS and USB0ID high +#define USB_GPCS_DEVMOD_HOSTVBUS \ + 0x00000004 // Use USB0VBUS and force USB0ID + // low +#define USB_GPCS_DEVMOD_DEVVBUS 0x00000005 // Use USB0VBUS and force USB0ID + // high + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_VDC register. +// +//***************************************************************************** +#define USB_VDC_VBDEN 0x00000001 // VBUS Droop Enable + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_VDCRIS register. +// +//***************************************************************************** +#define USB_VDCRIS_VD 0x00000001 // VBUS Droop Raw Interrupt Status + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_VDCIM register. +// +//***************************************************************************** +#define USB_VDCIM_VD 0x00000001 // VBUS Droop Interrupt Mask + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_VDCISC register. +// +//***************************************************************************** +#define USB_VDCISC_VD 0x00000001 // VBUS Droop Interrupt Status and + // Clear + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_PP register. +// +//***************************************************************************** +#define USB_PP_ECNT_M 0x0000FF00 // Endpoint Count +#define USB_PP_USB_M 0x000000C0 // USB Capability +#define USB_PP_USB_DEVICE 0x00000040 // DEVICE +#define USB_PP_USB_HOSTDEVICE 0x00000080 // HOST +#define USB_PP_USB_OTG 0x000000C0 // OTG +#define USB_PP_ULPI 0x00000020 // ULPI Present +#define USB_PP_PHY 0x00000010 // PHY Present +#define USB_PP_TYPE_M 0x0000000F // Controller Type +#define USB_PP_TYPE_0 0x00000000 // The first-generation USB + // controller +#define USB_PP_TYPE_1 0x00000001 // The second-generation USB + // controller revision +#define USB_PP_ECNT_S 8 + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_PC register. +// +//***************************************************************************** +#define USB_PC_ULPIEN 0x00010000 // ULPI Enable + +//***************************************************************************** +// +// The following are defines for the bit fields in the USB_O_CC register. +// +//***************************************************************************** +#define USB_CC_CLKEN 0x00000200 // USB Clock Enable +#define USB_CC_CSD 0x00000100 // Clock Source/Direction +#define USB_CC_CLKDIV_M 0x0000000F // PLL Clock Divisor +#define USB_CC_CLKDIV_S 0 + +#ifdef __cplusplus + } +#endif + +#endif diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h index eca8bf57553..596f7be6c44 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/st/stm32_fsdev/dcd_stm32_fsdev_pvt_st.h @@ -87,6 +87,10 @@ #include "stm32l1xx.h" #define PMA_LENGTH (512u) +#elif CFG_TUSB_MCU == OPT_MCU_STM32G4 + #include "stm32g4xx.h" + #define PMA_LENGTH (1024u) + #else #error You are using an untested or unimplemented STM32 variant. Please update the driver. // This includes L1x0, L1x1, L1x2, L4x2 and L4x3, G1x1, G1x3, and G1x4 diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_bcm.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_bcm.h index fcec0b0d212..353bc21ee7a 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_bcm.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_bcm.h @@ -34,7 +34,7 @@ #include "broadcom/interrupts.h" #include "broadcom/caches.h" -#define DWC2_REG_BASE 0xFE980000UL +#define DWC2_REG_BASE USB_OTG_GLOBAL_BASE #define DWC2_EP_MAX 8 #define DWC2_EP_FIFO_SIZE 4096 diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_type.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_type.h index 6e52ebc7b23..dbef20314c3 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_type.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_type.h @@ -416,6 +416,10 @@ TU_VERIFY_STATIC(offsetof(dwc2_regs_t, fifo ) == 0x1000, "incorrect size"); #define DCFG_PFIVL_0 (0x1UL << DCFG_PFIVL_Pos) // 0x00000800 */ #define DCFG_PFIVL_1 (0x2UL << DCFG_PFIVL_Pos) // 0x00001000 */ +#define DCFG_XCVRDLY_Pos (14U) +#define DCFG_XCVRDLY_Msk (0x1UL << DCFG_XCVRDLY_Pos) /*!< 0x00004000 */ +#define DCFG_XCVRDLY DCFG_XCVRDLY_Msk // Enables delay between xcvr_sel and txvalid during device chirp + #define DCFG_PERSCHIVL_Pos (24U) #define DCFG_PERSCHIVL_Msk (0x3UL << DCFG_PERSCHIVL_Pos) // 0x03000000 */ #define DCFG_PERSCHIVL DCFG_PERSCHIVL_Msk // Periodic scheduling interval */ diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_xmc.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_xmc.h new file mode 100644 index 00000000000..4e6bebb0167 --- /dev/null +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2/dwc2_xmc.h @@ -0,0 +1,87 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021 Rafael Silva (@perigoso) + * Copyright (c) 2021, Ha Thach (tinyusb.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * This file is part of the TinyUSB stack. + */ + +#ifndef _DWC2_XMC_H_ +#define _DWC2_XMC_H_ + +#ifdef __cplusplus + extern "C" { +#endif + +#include "xmc_device.h" + +// XMC has custom control register before DWC registers +#define DWC2_REG_BASE USB0_BASE +#define DWC2_EP_MAX 7 +#define DWC2_EP_FIFO_SIZE 2048 + +TU_ATTR_ALWAYS_INLINE +static inline void dwc2_dcd_int_enable(uint8_t rhport) +{ + (void) rhport; + NVIC_EnableIRQ(USB0_0_IRQn); +} + +TU_ATTR_ALWAYS_INLINE +static inline void dwc2_dcd_int_disable (uint8_t rhport) +{ + (void) rhport; + NVIC_DisableIRQ(USB0_0_IRQn); +} + +static inline void dwc2_remote_wakeup_delay(void) +{ + // try to delay for 1 ms +// uint32_t count = SystemCoreClock / 1000; +// while ( count-- ) __NOP(); +} + +// MCU specific PHY init, called BEFORE core reset +static inline void dwc2_phy_init(dwc2_regs_t * dwc2, uint8_t hs_phy_type) +{ + (void) dwc2; + (void) hs_phy_type; + + // Enable PHY + //USB->ROUTE = USB_ROUTE_PHYPEN; +} + +// MCU specific PHY update, it is called AFTER init() and core reset +static inline void dwc2_phy_update(dwc2_regs_t * dwc2, uint8_t hs_phy_type) +{ + (void) dwc2; + (void) hs_phy_type; + + // XMC Manual: turn around must be 5 (reset & default value) + // dwc2->gusbcfg = (dwc2->gusbcfg & ~GUSBCFG_TRDT_Msk) | (5u << GUSBCFG_TRDT_Pos); +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h index 4da07e24106..2edd310fa52 100644 --- a/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h +++ b/tools/sdk/esp32s2/include/arduino_tinyusb/tinyusb/src/tusb_option.h @@ -68,22 +68,27 @@ #define OPT_MCU_SAMX7X 207 ///< MicroChip SAME70, S70, V70, V71 family // STM32 -#define OPT_MCU_STM32F0 300 ///< ST STM32F0 -#define OPT_MCU_STM32F1 301 ///< ST STM32F1 -#define OPT_MCU_STM32F2 302 ///< ST STM32F2 -#define OPT_MCU_STM32F3 303 ///< ST STM32F3 -#define OPT_MCU_STM32F4 304 ///< ST STM32F4 -#define OPT_MCU_STM32F7 305 ///< ST STM32F7 -#define OPT_MCU_STM32H7 306 ///< ST STM32H7 -#define OPT_MCU_STM32L0 307 ///< ST STM32L0 -#define OPT_MCU_STM32L1 308 ///< ST STM32L1 -#define OPT_MCU_STM32L4 309 ///< ST STM32L4 +#define OPT_MCU_STM32F0 300 ///< ST F0 +#define OPT_MCU_STM32F1 301 ///< ST F1 +#define OPT_MCU_STM32F2 302 ///< ST F2 +#define OPT_MCU_STM32F3 303 ///< ST F3 +#define OPT_MCU_STM32F4 304 ///< ST F4 +#define OPT_MCU_STM32F7 305 ///< ST F7 +#define OPT_MCU_STM32H7 306 ///< ST H7 +#define OPT_MCU_STM32L1 308 ///< ST L1 +#define OPT_MCU_STM32L0 307 ///< ST L0 +#define OPT_MCU_STM32L4 309 ///< ST L4 +#define OPT_MCU_STM32G0 310 ///< ST G0 +#define OPT_MCU_STM32G4 311 ///< ST G4 // Sony #define OPT_MCU_CXD56 400 ///< SONY CXD56 -// TI MSP430 +// TI #define OPT_MCU_MSP430x5xx 500 ///< TI MSP430x5xx +#define OPT_MCU_MSP432E4 510 ///< TI MSP432E4xx +#define OPT_MCU_TM4C123 511 ///< TI Tiva-C 123x +#define OPT_MCU_TM4C129 512 ///< TI Tiva-C 129x // ValentyUSB eptri #define OPT_MCU_VALENTYUSB_EPTRI 600 ///< Fomu eptri config @@ -128,6 +133,9 @@ // Broadcom #define OPT_MCU_BCM2711 1700 ///< Broadcom BCM2711 +// Infineon +#define OPT_MCU_XMC4000 1800 ///< Infineon XMC4000 + // Helper to check if configured MCU is one of listed // Apply _TU_CHECK_MCU with || as separator to list of input #define _TU_CHECK_MCU(_m) (CFG_TUSB_MCU == _m) diff --git a/tools/sdk/esp32s2/include/config/sdkconfig.h b/tools/sdk/esp32s2/include/config/sdkconfig.h index 179e91a340e..f847f0cd99f 100644 --- a/tools/sdk/esp32s2/include/config/sdkconfig.h +++ b/tools/sdk/esp32s2/include/config/sdkconfig.h @@ -51,14 +51,14 @@ #define CONFIG_PARTITION_TABLE_MD5 1 #define CONFIG_ENABLE_ARDUINO_DEPENDS 1 #define CONFIG_AUTOSTART_ARDUINO 1 -#define CONFIG_ARDUINO_RUN_CORE1 1 -#define CONFIG_ARDUINO_RUNNING_CORE 1 +#define CONFIG_ARDUINO_RUN_CORE0 1 +#define CONFIG_ARDUINO_RUNNING_CORE 0 #define CONFIG_ARDUINO_LOOP_STACK_SIZE 8192 -#define CONFIG_ARDUINO_EVENT_RUN_CORE1 1 -#define CONFIG_ARDUINO_EVENT_RUNNING_CORE 1 -#define CONFIG_ARDUINO_UDP_RUN_CORE1 1 +#define CONFIG_ARDUINO_EVENT_RUN_CORE0 1 +#define CONFIG_ARDUINO_EVENT_RUNNING_CORE 0 +#define CONFIG_ARDUINO_UDP_RUN_CORE0 1 #define CONFIG_ARDUINO_UDP_TASK_PRIORITY 3 -#define CONFIG_ARDUINO_UDP_RUNNING_CORE 1 +#define CONFIG_ARDUINO_UDP_RUNNING_CORE 0 #define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR 1 #define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL 1 #define CONFIG_ARDUHAL_ESP_LOG 1 @@ -213,6 +213,7 @@ #define CONFIG_ESP_WIFI_FTM_ENABLE 1 #define CONFIG_ESP_WIFI_FTM_INITIATOR_SUPPORT 1 #define CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT 1 +#define CONFIG_ESP_WIFI_SOFTAP_SUPPORT 1 #define CONFIG_ESP_COREDUMP_ENABLE_TO_NONE 1 #define CONFIG_FATFS_CODEPAGE_850 1 #define CONFIG_FATFS_CODEPAGE 850 @@ -293,6 +294,7 @@ #define CONFIG_LWIP_ESP_GRATUITOUS_ARP 1 #define CONFIG_LWIP_GARP_TMR_INTERVAL 60 #define CONFIG_LWIP_TCPIP_RECVMBOX_SIZE 32 +#define CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID 1 #define CONFIG_LWIP_DHCP_RESTORE_LAST_IP 1 #define CONFIG_LWIP_DHCP_OPTIONS_LEN 128 #define CONFIG_LWIP_DHCPS 1 @@ -326,7 +328,9 @@ #define CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS 5 #define CONFIG_LWIP_ICMP 1 #define CONFIG_LWIP_MAX_RAW_PCBS 16 -#define CONFIG_LWIP_SNTP_MAX_SERVERS 1 +#define CONFIG_LWIP_SNTP_MAX_SERVERS 3 +#define CONFIG_LWIP_DHCP_GET_NTP_SRV 1 +#define CONFIG_LWIP_DHCP_MAX_NTP_SERVERS 1 #define CONFIG_LWIP_SNTP_UPDATE_DELAY 3600000 #define CONFIG_LWIP_ESP_LWIP_ASSERT 1 #define CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT 1 @@ -575,5 +579,5 @@ #define CONFIG_USB_MSC_BUFSIZE CONFIG_TINYUSB_MSC_BUFSIZE #define CONFIG_USB_MSC_ENABLED CONFIG_TINYUSB_MSC_ENABLED #define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS -#define CONFIG_ARDUINO_IDF_COMMIT "6a7d83af19" +#define CONFIG_ARDUINO_IDF_COMMIT "a79dc75f0a" #define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4" diff --git a/tools/sdk/esp32s2/include/driver/include/driver/mcpwm.h b/tools/sdk/esp32s2/include/driver/include/driver/mcpwm.h index 2a4e825f77c..fed2c3f326d 100644 --- a/tools/sdk/esp32s2/include/driver/include/driver/mcpwm.h +++ b/tools/sdk/esp32s2/include/driver/include/driver/mcpwm.h @@ -174,7 +174,6 @@ typedef enum { /** * @brief Interrupt masks for MCPWM capture */ -__attribute__ ((deprecated("please use callback function to avoid directly accessing registers"))) typedef enum { MCPWM_LL_INTR_CAP0 = BIT(27), ///< Capture 0 happened MCPWM_LL_INTR_CAP1 = BIT(28), ///< Capture 1 happened @@ -922,7 +921,6 @@ esp_err_t mcpwm_sync_invert_gpio_synchro(mcpwm_unit_t mcpwm_num, mcpwm_sync_sign * - ESP_OK Success * - ESP_ERR_INVALID_ARG Function pointer error. */ -__attribute__((deprecated("interrupt events are handled by driver, please use callback"))) esp_err_t mcpwm_isr_register(mcpwm_unit_t mcpwm_num, void (*fn)(void *), void *arg, int intr_alloc_flags, intr_handle_t *handle); diff --git a/tools/sdk/esp32s2/include/efuse/include/esp_efuse.h b/tools/sdk/esp32s2/include/efuse/include/esp_efuse.h index a44aa798720..02300ccfa72 100644 --- a/tools/sdk/esp32s2/include/efuse/include/esp_efuse.h +++ b/tools/sdk/esp32s2/include/efuse/include/esp_efuse.h @@ -6,11 +6,9 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - +#include #include + #include "esp_err.h" #include "esp_log.h" #include "soc/soc_caps.h" @@ -29,6 +27,10 @@ extern "C" { #include "esp32h2/rom/secure_boot.h" #endif +#ifdef __cplusplus +extern "C" { +#endif + #define ESP_ERR_EFUSE 0x1600 /*!< Base error code for efuse api. */ #define ESP_OK_EFUSE_CNT (ESP_ERR_EFUSE + 0x01) /*!< OK the required number of bits is set. */ #define ESP_ERR_EFUSE_CNT_IS_FULL (ESP_ERR_EFUSE + 0x02) /*!< Error field is full. */ diff --git a/tools/sdk/esp32s2/include/esp-face/include/image/dl_image.hpp b/tools/sdk/esp32s2/include/esp-face/include/image/dl_image.hpp index 4a974df063a..8e8a4df705b 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/image/dl_image.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/image/dl_image.hpp @@ -48,6 +48,15 @@ namespace dl output[2] = input & 0xF8; // red } + /** + * @brief Convert RGB565 image to RGB888 image. + * + * @param image ptr of RGB565 image + * @param image_shape shape of the input image + * @return Tensor* output RGB88 image + */ + Tensor *convert_image_rgb565_to_rgb888(uint16_t *image, std::vector &image_shape); + /** * @brief Convert RGB565 pixel to Gray. * @@ -435,5 +444,48 @@ namespace dl */ Tensor *rgb2hsv(Tensor &image, bool bgr = false, bool fast = true); + /** + * @brief resize an image to the target shape. + * + * @param image the input image Tensor + * @param target_shape the target shape of the resized image. + * @param resize_type one of IMAGE_RESIZE_BILINEAR or IMAGE_RESIZE_MEAN or IMAGE_RESIZE_NEAREST + * @return Tensor* the pointer of the resized image Tensor + */ + Tensor *resize_image(Tensor &image, std::vector target_shape, resize_type_t resize_type); + + /** + * @brief resize an image to the target shape. + * + * @param image the input image Tensor + * @param resized_image the resized image Tensor + * @param resize_type one of IMAGE_RESIZE_BILINEAR or IMAGE_RESIZE_MEAN or IMAGE_RESIZE_NEAREST + */ + void resize_image(Tensor &image, Tensor &resized_image, resize_type_t resize_type); + + /** + * @brief resize an image to the target shape with nearest method. + * + * @tparam T + * @param image the pointer of the input image + * @param input_shape the input shape of the image + * @param target_shape the target shape of the resized image + * @return T* the pointer of the resized image + */ + template + T *resize_image_nearest(T *image, std::vector input_shape, std::vector target_shape); + + /** + * @brief resize an image to the target shape with nearest method. + * + * @tparam T + * @param image the pointer of the input image + * @param input_shape the input shape of the image + * @param resized_image the pointer of the resized image + * @param target_shape the target shape of the resized image + */ + template + void resize_image_nearest(T *image, std::vector input_shape, T *resized_image, std::vector target_shape); + } // namespace image } // namespace dl diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp index 8a9aaa8dfbe..57c7fb64a9a 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_avg_pool2d.hpp @@ -57,10 +57,10 @@ namespace dl const char *name = "AvgPool2D") : Layer(name), output_exponent(output_exponent), filter_shape(filter_shape), - padding_type(padding_type), - padding(padding), stride_y(stride_y), stride_x(stride_x), + padding_type(padding_type), + padding(padding), output_shape({}) { this->output = new Tensor; diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_expand_dims.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_expand_dims.hpp index a59bed183fb..99fdc2ed607 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_expand_dims.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_expand_dims.hpp @@ -36,7 +36,10 @@ namespace dl * false: the output will store to a separate memory */ ExpandDims(std::vector axis, const char *name = "ExpandDims", bool inplace = false) : Layer(name), - axis(axis), inplace(inplace), output_shape({}) + output_shape({}), + axis(axis), + output(NULL), + inplace(inplace) { } @@ -63,19 +66,18 @@ namespace dl this->output_exponent = input.exponent; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } this->output->set_exponent(this->output_exponent); - this->output->set_shape(this->output_shape); + this->output->set_shape(input.shape); this->output->expand_dims(this->axis); this->output->free_element(); } else { this->output = &input; - this->output->set_shape(this->output_shape); this->output->expand_dims(this->axis); } this->output_shape = this->output->shape; diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_flatten.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_flatten.hpp index 70ae483a07f..380df1a413b 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_flatten.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_flatten.hpp @@ -32,7 +32,7 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - Flatten(const char *name = "Flatten", bool inplace = false) : Layer(name), inplace(inplace), output_shape({}) + Flatten(const char *name = "Flatten", bool inplace = false) : Layer(name), output(NULL), inplace(inplace), output_shape({}) {} /** @@ -59,7 +59,7 @@ namespace dl this->output_shape = {input.get_size()}; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_leakyrelu.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_leakyrelu.hpp index a972e135006..773c62430f2 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_leakyrelu.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_leakyrelu.hpp @@ -10,14 +10,14 @@ namespace dl namespace layer { /** - * @brief LeakyReLU(input). + * @brief LeakyRelu(input). * * @tparam feature_t supports int16_t and int8_t, * - int16_t: stands for operation in int16_t quantize * - int8_t: stands for operation in int8_t quantize */ template - class LeakyReLU : public Layer + class LeakyRelu : public Layer { private: feature_t activation_alpha; /**/ @@ -28,7 +28,7 @@ namespace dl std::vector output_shape; /**/ public: /** - * @brief Construct a new LeakyReLU object + * @brief Construct a new LeakyRelu object * * @param activation_alpha quantized alpha * @param activation_exponent exponent of quantized alpha @@ -36,7 +36,7 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - LeakyReLU(const int activation_alpha, const int activation_exponent, const char *name = "LeakyReLU", bool inplace = false) : Layer(name), output(NULL), output_shape({}) + LeakyRelu(const int activation_alpha, const int activation_exponent, const char *name = "LeakyRelu", bool inplace = false) : Layer(name), output(NULL), output_shape({}) { this->activation_alpha = activation_alpha; this->activation_exponent = activation_exponent; @@ -44,10 +44,10 @@ namespace dl } /** - * @brief Destroy the LeakyReLU object + * @brief Destroy the LeakyRelu object * */ - ~LeakyReLU() + ~LeakyRelu() { if ((!this->inplace) && (this->output != NULL)) { @@ -66,7 +66,7 @@ namespace dl this->output_shape = input.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -90,7 +90,7 @@ namespace dl /** * @brief Get the output * - * @return Tensor& LeakyReLU result + * @return Tensor& LeakyRelu result */ Tensor &get_output() { @@ -98,11 +98,11 @@ namespace dl } /** - * @brief Call LeakyReLU operation. + * @brief Call LeakyRelu operation. * * @param input as an input * @param assign_core not effective yet - * @return LeakyReLU result + * @return LeakyRelu result */ Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) { @@ -130,7 +130,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::leakyrelu(*this->output, input, this->activation_alpha, this->activation_exponent, assign_core); + nn::leakyrelu(*this->output, input, this->activation_alpha, this->activation_exponent, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "leakyrelu"); } diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_max2d.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_max2d.hpp index c6be15638ab..e7defa0b08f 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_max2d.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_max2d.hpp @@ -68,7 +68,7 @@ namespace dl if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -132,7 +132,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::max2d(*this->output, input0, input1, assign_core); + nn::max2d(*this->output, input0, input1, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "max2d"); } diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_max_pool2d.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_max_pool2d.hpp index 629aa87f515..7c7fc69fa71 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_max_pool2d.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_max_pool2d.hpp @@ -53,10 +53,10 @@ namespace dl const int stride_x = 1, const char *name = "MaxPool2D") : Layer(name), filter_shape(filter_shape), - padding_type(padding_type), - padding(padding), stride_y(stride_y), stride_x(stride_x), + padding_type(padding_type), + padding(padding), output_shape({}) { this->output = new Tensor; diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_min2d.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_min2d.hpp index e38fbf3d0d2..609566348d3 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_min2d.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_min2d.hpp @@ -68,7 +68,7 @@ namespace dl if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -132,7 +132,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::min2d(*this->output, input0, input1, assign_core); + nn::min2d(*this->output, input0, input1, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "min2d"); } diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_mul2d.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_mul2d.hpp index 21bcca7a81e..a391c790335 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_mul2d.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_mul2d.hpp @@ -75,7 +75,7 @@ namespace dl if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -140,7 +140,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::mul2d(*this->output, input0, input1, this->activation, assign_core); + nn::mul2d(*this->output, input0, input1, this->activation, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "mul2d"); } diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_prelu.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_prelu.hpp index 96168a783b1..2141e986646 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_prelu.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_prelu.hpp @@ -10,17 +10,17 @@ namespace dl namespace layer { /** - * @brief PReLU(input). + * @brief PRelu(input). * * @tparam feature_t supports int16_t and int8_t, * - int16_t: stands for operation in int16_t quantize * - int8_t: stands for operation in int8_t quantize */ template - class PReLU : public Layer + class PRelu : public Layer { private: - feature_t *activation_element; /**/ + const feature_t *activation_element; /**/ int activation_exponent; /**/ Tensor *output; /**/ bool inplace; /* output_shape; /**/ public: /** - * @brief Construct a new PReLU object + * @brief Construct a new PRelu object * * @param activation_element quantized alpha elements along channel axis * @param activation_exponent exponent of quantized alpha elements @@ -36,10 +36,10 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - PReLU(const feature_t *activation_element, + PRelu(const feature_t *activation_element, const int activation_exponent = 0, - const char *name = NULL, - bool inplace = "PReLU") : Layer(name), + const char *name = "PRelu", + bool inplace = false) : Layer(name), activation_element(activation_element), activation_exponent(activation_exponent), output(NULL), @@ -49,10 +49,10 @@ namespace dl } /** - * @brief Destroy the PReLU object + * @brief Destroy the PRelu object * */ - ~PReLU() + ~PRelu() { if ((!this->inplace) && (this->output != NULL)) { @@ -71,7 +71,7 @@ namespace dl this->output_shape = input.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -94,7 +94,7 @@ namespace dl /** * @brief Get the output * - * @return Tensor& PReLU result + * @return Tensor& PRelu result */ Tensor &get_output() { @@ -102,11 +102,11 @@ namespace dl } /** - * @brief Call PReLU operation. + * @brief Call PRelu operation. * * @param input as an input * @param assign_core not effective yet - * @return PReLU result + * @return PRelu result */ Tensor &call(Tensor &input, const std::vector &assign_core = CONFIG_DEFAULT_ASSIGN_CORE) { @@ -125,7 +125,7 @@ namespace dl DL_LOG_LAYER_LATENCY_START(); nn::prelu(*this->output, input, this->activation_element, this->activation_exponent, assign_core); - DL_LOG_LAYER_LATENCY_END(this->name, "leakyrelu"); + DL_LOG_LAYER_LATENCY_END(this->name, "prelu"); } else { @@ -135,7 +135,7 @@ namespace dl this->output->set_shape(this->output_shape); } nn::prelu(*this->output, input, this->activation_element, this->activation_exponent, assign_core); - DL_LOG_LAYER_LATENCY_END(this->name, "leakyrelu"); + DL_LOG_LAYER_LATENCY_END(this->name, "prelu"); } return *this->output; diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_relu.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_relu.hpp index 7dd29d4a178..dff05c7f420 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_relu.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_relu.hpp @@ -18,7 +18,7 @@ namespace dl * - int8_t: stands for operation in int8_t quantize */ template - class ReLU : public Layer + class Relu : public Layer { private: Tensor *output; /**/ @@ -33,7 +33,7 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - ReLU(const char *name = "ReLU", bool inplace = false) : Layer(name), + Relu(const char *name = "Relu", bool inplace = false) : Layer(name), output(NULL), inplace(inplace), output_shape({}) { } @@ -42,7 +42,7 @@ namespace dl * @brief Destroy the ReLU object * */ - ~ReLU() + ~Relu() { if ((!this->inplace) && (this->output != NULL)) { @@ -61,7 +61,7 @@ namespace dl this->output_shape = input.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_reshape.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_reshape.hpp index 3f2ed72b6e0..2ef76ef96d8 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_reshape.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_reshape.hpp @@ -35,7 +35,9 @@ namespace dl * false: the output will store to a separate memory */ Reshape(std::vector shape, const char *name = "Reshape", bool inplace = false) : Layer(name), - output_shape(shape), inplace(inplace) + output(NULL), + inplace(inplace), + output_shape(shape) { } @@ -62,19 +64,21 @@ namespace dl this->output_exponent = input.exponent; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } this->output->set_exponent(this->output_exponent); - this->output->set_shape(this->output_shape); + this->output->set_shape(input.shape); + this->output->reshape(this->output_shape); this->output->free_element(); } else { this->output = &input; - this->output->set_shape(this->output_shape); + this->output->reshape(this->output_shape); } + this->output_shape = this->output->shape; if (print_shape) { diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_squeeze.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_squeeze.hpp index cee92f22764..710901a3d02 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_squeeze.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_squeeze.hpp @@ -35,7 +35,11 @@ namespace dl * @param inplace true: the output will store to input0 * false: the output will store to a separate memory */ - Squeeze(int axis = INT32_MAX, const char *name = "Squeeze", bool inplace = false) : Layer(name), axis(axis), inplace(inplace), output_shape({}) + Squeeze(int axis = INT32_MAX, const char *name = "Squeeze", bool inplace = false) : Layer(name), + output(NULL), + inplace(inplace), + axis(axis), + output_shape({}) { } @@ -62,7 +66,7 @@ namespace dl this->output_exponent = input.exponent; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -74,7 +78,6 @@ namespace dl else { this->output = &input; - this->output->set_shape(input.shape); this->output->squeeze(this->axis); } this->output_shape = this->output->shape; diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_sub2d.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_sub2d.hpp index da03b4aad85..61bcc9f2804 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_sub2d.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_sub2d.hpp @@ -38,7 +38,11 @@ namespace dl * false: the output will store to a separate memory */ Sub2D(const int output_exponent, const Activation *activation = NULL, const char *name = "Sub2D", bool inplace = false) : Layer(name), - output_exponent(output_exponent), activation(activation), output(NULL), inplace(inplace), output_shape({}) + output_exponent(output_exponent), + activation(activation), + output(NULL), + inplace(inplace), + output_shape({}) { } @@ -67,7 +71,7 @@ namespace dl this->output_shape = input0.shape; if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } @@ -116,12 +120,12 @@ namespace dl { this->output->set_shape(this->output_shape); } - this->output.malloc_element(); + this->output->malloc_element(); this->output->set_exponent(input0.exponent); DL_LOG_LAYER_LATENCY_END(this->name, "apply"); DL_LOG_LAYER_LATENCY_START(); - nn::sub2d(this->output, input0, input1, this->activation, assign_core); + nn::sub2d(*this->output, input0, input1, this->activation, assign_core); DL_LOG_LAYER_LATENCY_END(this->name, "sub2d"); } else @@ -131,7 +135,7 @@ namespace dl { this->output->set_shape(this->output_shape); } - nn::sub2d(this->output, input0, input1, this->activation, assign_core, this->output_exponent); + nn::sub2d(*this->output, input0, input1, this->activation, assign_core, this->output_exponent); DL_LOG_LAYER_LATENCY_END(this->name, "sub2d"); } return *this->output; diff --git a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_transpose.hpp b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_transpose.hpp index d89ba8daed5..87e9cce5ce4 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_transpose.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/layer/dl_layer_transpose.hpp @@ -33,7 +33,11 @@ namespace dl * @param inplace true: the output will store to input * false: the output will store to a separate memory */ - Transpose(std::vector perm = {}, const char *name = "Transpose", bool inplace = false) : Layer(name), perm(perm), inplace(inplace), output_shape({}) + Transpose(std::vector perm = {}, const char *name = "Transpose", bool inplace = false) : Layer(name), + output(NULL), + inplace(inplace), + perm(perm), + output_shape({}) { } @@ -59,13 +63,24 @@ namespace dl { this->output_exponent = input.exponent; this->output_shape = input.shape; - for (int i = 0; i < this->perm.size(); i++) + int dims = this->output_shape.size(); + if (this->perm.size() == 0) { + for (int i = dims - 1; i >= 0; i--) + { + this->perm.push_back(i); + } + } + for (int i = 0; i < dims; ++i) + { + if (this->perm[i] < 0) + this->perm[i] = dims + this->perm[i]; this->output_shape[i] = input.shape[this->perm[i]]; } + if (!this->inplace) { - if (this->output != NULL) + if (this->output == NULL) { this->output = new Tensor; } diff --git a/tools/sdk/esp32s2/include/esp-face/include/model_zoo/color_detector.hpp b/tools/sdk/esp32s2/include/esp-face/include/model_zoo/color_detector.hpp index 063ab20b34a..f79f98c0fd2 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/model_zoo/color_detector.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/model_zoo/color_detector.hpp @@ -7,46 +7,143 @@ typedef struct int area; /*!< Area of connected domains >*/ std::vector center; /**/ std::vector box; /**/ -} components_stats_t; +} color_detect_result_t; + +typedef struct +{ + std::vector start_col; + std::vector end_col; + std::vector row; + std::vector index; + std::vector area; +} color_segment_result_t; + +typedef struct +{ + std::vector color_thresh; /*!< threshold of colors, The threshold of each color is composed of 6 numbers >*/ + int area_thresh; /*!< the area threshold of each color, + the area that is smaller than the threshold is filtered >*/ + std::string name; /*!*/ +} color_info_t; class ColorDetector { private: - std::vector> results; /*!< detection results >*/ - -public: - std::vector> color_thresh; /*!< threshold of colors, The threshold of each color is composed of 6 numbers >*/ - std::vector area_thresh; /*!< the area threshold of each color, - the area that is smaller than the threshold is filtered >*/ - bool bgr; /*!< true: the input image is in BGR format + std::vector> detection_results; /*!< detection results >*/ + std::vector segmentation_results; /*!< segmentation results >*/ + std::vector registered_colors; /*!< the infomation of registered colors >*/ + std::vector color_thresh_offset; /*!< HSV offset of the registered colors>*/ + std::vector detection_shape; /*!< the inference shape of images, the input image will be resized to this shape. + if the shape == {}, the input image will not be resized >*/ + bool bgr; /*!< true: the input image is in BGR format false: the input image is in RGB format >*/ + int id_nums; /*!< the number of registered colors in history>*/ + float h_ratio; + float w_ratio; + void color_detection_forward(dl::Tensor &bin, int area_thresh); +public: /** * @brief get the color threshold of rectangular region in the image * - * @param image the input image + * @param image the input image in RGB888 format. * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] * @return std::vector the threshold. */ std::vector cal_color_thresh(dl::Tensor &image, std::vector box); + /** + * @brief get the color threshold of rectangular region in the image + * + * @param input the ptr of RGB565 image. + * @param input_shape shape of the input image. + * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] + * @return std::vector the threshold. + */ + std::vector cal_color_thresh(uint16_t *input, std::vector input_shape, std::vector box); + + /** + * @brief register a new color to the color detector + * + * @param image the input image in RGB888 format. + * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] + * @param area_thresh the area threshold of the color + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int register_color(dl::Tensor &image, std::vector box, int area_thresh = 256, std::string color_name = "", int id = -1); + + /** + * @brief register a new color to the color detector + * + * @param input the ptr of RGB565 image. + * @param input_shape shape of the input image. + * @param box the coordinates of the rectanglar region : [left_up_x, left_up_y, right_down_x, right_down_y] + * @param area_thresh the area threshold of the color + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int register_color(uint16_t *input, std::vector input_shape, std::vector box, int area_thresh = 256, std::string color_name = "", int id = -1); + + /** + * @brief register a new color to the color detector + * + * @param color_thresh the color threshold + * @param area_thresh the area threshold of the color + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int register_color(std::vector color_thresh, int area_thresh = 256, std::string color_name = "", int id = -1); + + /** + * @brief delete a registered color + * + * @param id the index of the color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int delete_color(int id = -1); + + /** + * @brief delete a registered color + * + * @param color_name name of the registered_color + * @return int the number of the registered colors. if the id is not valid, return -1. + */ + int delete_color(std::string color_name); + + /** + * @brief delete all the registered colors + * + */ + void clear_color(); + /** * @brief detect the colors based on the color thresholds * * @param image the input image. - * @return std::vector>& detection result. + * @return std::vector>& detection result. + */ + std::vector> &detect(dl::Tensor &image, std::vector color_ids = {}); + + /** + * @brief + * + * @param input + * @param input_shape + * @return std::vector>& */ - std::vector> &detect(dl::Tensor &image); + std::vector> &detect(uint16_t *input_shape, std::vector shape, std::vector color_ids = {}); /** * @brief Construct a new Color Detector object * - * @param color_thresh threshold of colors, The threshold of each color is composed of 6 numbers - * @param area_thresh the area threshold of each color,the area that is smaller than the threshold is filtered + * @param color_thresh_offset HSV offset of the registered colors> + * @param detection_shape the inference shape of images, the input image will be resized to this shape * @param bgr true: the input image is in BGR format * false: the input image is in RGB format */ - ColorDetector(std::vector> color_thresh, std::vector area_thresh, bool bgr = false) : color_thresh(color_thresh), area_thresh(area_thresh), bgr(bgr) + ColorDetector(std::vector color_thresh_offset = {}, std::vector detection_shape = {}, bool bgr = true) : color_thresh_offset(color_thresh_offset), + detection_shape(detection_shape), bgr(bgr), id_nums(0) { } @@ -57,12 +154,213 @@ class ColorDetector ~ColorDetector() {} /** - * @brief Get the results object + * @brief Get the detection results object + * + * @return std::vector>& the detection result. + */ + std::vector> &get_detection_results() + { + return this->detection_results; + } + + /** + * @brief Get the segmentation results object * - * @return std::vector>& the detection result. + * @return std::vector& the segmentation result. */ - std::vector> &get_results() + std::vector &get_segmentation_results() { - return this->results; + return this->segmentation_results; } + + /** + * @brief Get the registered colors object + * + * @return std::vector the information of resgistered colors + */ + std::vector get_registered_colors() + { + return this->registered_colors; + } + + /** + * @brief Set the color thresh offset object + * + * @param color_thresh_offset the offset of color thresh for registered colors + * @return ColorDetector& + */ + ColorDetector &set_color_thresh_offset(std::vector color_thresh_offset) + { + assert(color_thresh_offset.size() == 3); + this->color_thresh_offset = color_thresh_offset; + return *this; + } + + /** + * @brief Get the color thresh offset object + * + * @return std::vector color_thresh_offset + */ + std::vector get_color_thresh_offset() + { + return this->color_thresh_offset; + } + + /** + * @brief Set the area thresh object + * + * @param area_thresh the area thresh for each registered colors + * @return ColorDetector& + */ + ColorDetector &set_area_thresh(std::vector area_thresh) + { + assert((area_thresh.size() == this->registered_colors.size()) || (area_thresh.size() == 1)); + if (area_thresh.size() == 1) + { + for (int i = 0; i < this->registered_colors.size(); ++i) + { + this->registered_colors[i].area_thresh = area_thresh[0]; + } + } + else + { + for (int i = 0; i < this->registered_colors.size(); ++i) + { + this->registered_colors[i].area_thresh = area_thresh[i]; + } + } + return *this; + } + + /** + * @brief Set the area thresh object + * + * @param area_thresh the area thresh for each registered colors + * @param id index of the registered color + * @return ColorDetector& + */ + ColorDetector &set_area_thresh(int area_thresh, int id) + { + assert((id >= 0) && (id < this->registered_colors.size())); + this->registered_colors[id].area_thresh = area_thresh; + return *this; + } + + /** + * @brief Set the bgr object + * + * @param bgr + * @return ColorDetector& + */ + ColorDetector &set_bgr(bool bgr) + { + this->bgr = bgr; + return *this; + } + + /** + * @brief Get the bgr object + * + * @return bool bgr flag + */ + bool get_bgr() + { + return this->bgr; + } + + /** + * @brief Get the detection shape object + * + * @return std::vector + */ + std::vector get_detection_shape() + { + return this->detection_shape; + } + + /** + * @brief Set the detection shape object + * + * @param detection_shape the inference shape of images, the input image will be resized to this shape + * @return ColorDetector& + */ + ColorDetector &set_detection_shape(std::vector detection_shape) + { + assert(detection_shape.size() == 3); + this->detection_shape = detection_shape; + return *this; + } + + /** + * @brief Get the registered colors num + * + * @return int the registered colors num + */ + int get_registered_colors_num() + { + return this->registered_colors.size(); + } + + /** + * @brief print the detection detection results + * + * @param tag + */ + void print_detection_results(const char *tag = "RGB") + { + printf("\n%s | color detection result:\n", tag); + for (int i = 0; i < this->detection_results.size(); ++i) + { + printf("color %d: detected box :%d\n", i, this->detection_results[i].size()); + for (int j = 0; j < this->detection_results[i].size(); ++j) + { + printf("center: (%d, %d)\n", this->detection_results[i][j].center[0], this->detection_results[i][j].center[1]); + printf("box: (%d, %d), (%d, %d)\n", this->detection_results[i][j].box[0], this->detection_results[i][j].box[1], this->detection_results[i][j].box[2], this->detection_results[i][j].box[3]); + printf("area: %d\n", this->detection_results[i][j].area); + } + printf("\n"); + } + } + + /** + * @brief print the segmentation results + * + * @param tag + */ + void print_segmentation_results(const char *tag = "RGB") + { + printf("\n%s | color segmentation result:\n", tag); + for (int i = 0; i < this->segmentation_results.size(); ++i) + { + printf("color %d: detected box :%d\n", i, this->detection_results[i].size()); + for (int j = 0; j < this->segmentation_results[i].index.size(); ++j) + { + printf("box_index: %d, start col: %d, end col: %d, row: %d, area: %d\n", + this->segmentation_results[i].index[j], this->segmentation_results[i].start_col[j], this->segmentation_results[i].end_col[j], + this->segmentation_results[i].row[j], this->segmentation_results[i].area[j]); + } + printf("\n"); + } + } + + /** + * @brief draw the color segmentation result on the input image + * + * @param image the input RGB image + * @param draw_colors RGB values for each detected colors + * @param draw_backgound draw the background if it is true + * @param background_color RGB values for the background color + */ + void draw_segmentation_results(dl::Tensor &image, std::vector> draw_colors, bool draw_backgound = true, std::vector background_color = {0, 0, 0}); + + /** + * @brief draw the color segmentation result on the input image + * + * @param image the pointer of the input RGB565 image + * @param image_shape the shape of the input image + * @param draw_colors RGB565 values for each detected colors + * @param draw_backgound draw the background if it is true + * @param background_color RGB565 values for the background color + */ + void draw_segmentation_results(uint16_t *image, std::vector image_shape, std::vector draw_colors, bool draw_backgound = true, uint16_t background_color = 0x0000); }; \ No newline at end of file diff --git a/tools/sdk/esp32s2/include/esp-face/include/model_zoo/face_recognition_tool.hpp b/tools/sdk/esp32s2/include/esp-face/include/model_zoo/face_recognition_tool.hpp index 2226d32daf9..3adf1f62f72 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/model_zoo/face_recognition_tool.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/model_zoo/face_recognition_tool.hpp @@ -10,6 +10,7 @@ #include #include #include +#include "esp_partition.h" /** * @brief struct of face similarity @@ -45,6 +46,13 @@ class FaceID */ FaceID(int id, dl::Tensor &id_emb, std::string name = ""); + /** + * @brief Construct a new Face ID which is same as input face_id + * + * @param face_id input face_id + */ + FaceID(FaceID &face_id); + /** * @brief Destroy the Face ID object * diff --git a/tools/sdk/esp32s2/include/esp-face/include/model_zoo/face_recognizer.hpp b/tools/sdk/esp32s2/include/esp-face/include/model_zoo/face_recognizer.hpp index 864881c984a..0f6b854118b 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/model_zoo/face_recognizer.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/model_zoo/face_recognizer.hpp @@ -148,7 +148,7 @@ class FaceRecognizer * @param name name of the face id. * @return int the face id index of the enrolled embedding. */ - int enroll_id(uint16_t *image_input, std::vector shape, std::vector &landmarks, std::string name=""); + int enroll_id(uint16_t *image_input, std::vector shape, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id @@ -158,9 +158,11 @@ class FaceRecognizer * @param aligned_face the Tensor to store the intermeidate aligned face. * @param landmarks face landmarks coordinates * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(uint16_t *image_input, std::vector shape, Tensor &aligned_face, std::vector &landmarks, std::string name=""); + int enroll_id(uint16_t *image_input, std::vector shape, Tensor &aligned_face, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id @@ -168,9 +170,11 @@ class FaceRecognizer * @param image_input the Tensor of input image with format bgr888. * @param landmarks face landmarks coordinates * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &image_input, std::vector &landmarks, std::string name=""); + int enroll_id(Tensor &image_input, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id @@ -179,42 +183,114 @@ class FaceRecognizer * @param aligned_face the Tensor to store the intermeidate aligned face. * @param landmarks face landmarks coordinates * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &image_input, Tensor &aligned_face, std::vector &landmarks, std::string name=""); + int enroll_id(Tensor &image_input, Tensor &aligned_face, std::vector &landmarks, std::string name="", bool update_flash = false); /** * @brief enroll face id * * @param aligned_face the Tensor of the input aligned face with format bgr888. * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &aligned_face, std::string name=""); + int enroll_id(Tensor &aligned_face, std::string name="", bool update_flash = false); /** * @brief enroll the normalzied face embedding. * - * @param emb the normalized face embbeding. - * @param name name of the face id. - * @return int the face id index of the enrolled embedding. + * @param emb the normalized face embbeding. + * @param name name of the face id. + * @param update_flash true: the enrolled ids will be stored to flash + * false: the enrolled ids will not be stored to flash + * @return int the face id index of the enrolled embedding. */ - int enroll_id(Tensor &emb, std::string name=""); + int enroll_id(Tensor &emb, std::string name="", bool update_flash = false); /** - * @brief delete the last enrolled face id. + * @brief delete the last enrolled face id. + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash * * @return int the number of remained face ids. * if the face ids list is empty, return -1 */ - int delete_id(); + int delete_id(bool update_flash = false); /** - * @brief delete the face id with id index. + * @brief delete the face id with id index. * - * @param id face id index. - * @return int the number of remained face ids. - * if there is no matched id return -1 + * @param id face id index. + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash + * @return int the number of remained face ids. + * if there is no matched id return -1 + */ + int delete_id(int id, bool update_flash = false); + + /** + * @brief Set the enrolled ids + * + * @param ids the ids to be set + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash + * @return int the number of enrolled ids. + */ + int set_ids(std::vector *> &ids, bool update_flash = false); + + /** + * @brief Set the enrolled ids from flash + * + * @return int the number of enrolled ids. + */ + int set_ids_from_flash(); + + /** + * @brief write the enrolled ids to flash + * + * @return int the number of enrolled ids. */ - int delete_id(int id); + int write_ids_to_flash(); + + /** + * @brief Get the enrolled ids with name object + * + * @param name + * @return std::vector + */ + std::vector get_enrolled_ids_with_name(std::string name); + + /** + * @brief Check whether the Flash partition is available + * + * @return int -2: the partition has not been set + * -1: the data in the flash does not match the current model. + * model_check_code: the Flash partition is available. + * number of ids in flash: The IDs in Flash and RAM does not sync. + */ + int check_partition(); + + /** + * @brief delete all the enrolled face ids. + * @param update_flash true: the ids will be updated to flash + * false: the ids will not be stored to flash + * + */ + void clear_id(bool update_flash = false); + + /** + * @brief Set the partition for saving face ids to flash or reading face ids from flash. + * + * @param type esp_partition_type + * @param subtype esp_partition_subtype + * @param label the partition label + * @return int 0: set the partition failed + * 1: set the partition successfully + */ + int set_partition(esp_partition_type_t type, esp_partition_subtype_t subtype, const char *label); + }; \ No newline at end of file diff --git a/tools/sdk/esp32s2/include/esp-face/include/typedef/dl_constant.hpp b/tools/sdk/esp32s2/include/esp-face/include/typedef/dl_constant.hpp index 07b2dd24ee1..a111817e3d6 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/typedef/dl_constant.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/typedef/dl_constant.hpp @@ -2,6 +2,7 @@ #include "dl_define.hpp" #include +#include namespace dl { @@ -48,10 +49,11 @@ namespace dl /**/ std::vector shape_with_dilation; /**/ /**/ - std::vector channel_exponent; /**/ + const int8_t* channel_exponent; /**/ + const int channel_exponent_size; /** - * @brief Construct a new Filter object. + * @brief Construct a new Filter object. * * @param element point to element * @param exponent exponent of element @@ -66,16 +68,17 @@ namespace dl Filter(const T *element, const int exponent, const std::vector shape, const std::vector dilation = {1, 1}); /** - * @brief Construct a new Filter object. + * @brief Construct a new Filter object. it is only avaliable to int16_t * - * @param element point to element - * @param channel_exponent exponent for per-channel - * @param shape shape of element - * @param dilation dilation of Filter - * - 1D: reserved - * - 2D: [dilation_in_height, dilation_in_width] + * @param element point to element + * @param channel_exponent exponent for per-channel + * @param channel_exponent_size size of exponent + * @param shape shape of element + * @param dilation dilation of Filter + * - 1D: reserved + * - 2D: [dilation_in_height, dilation_in_width] */ - Filter(const T *element, const std::vector channel_exponent, const std::vector shape, const std::vector dilation = {1, 1}); + Filter(const T *element, const int8_t* channel_exponent, const int channel_exponent_size, const std::vector shape, const std::vector dilation = {1, 1}); /** * @brief Print the n-th filter. @@ -98,9 +101,6 @@ namespace dl { public: using Constant::Constant; - std::vector channel_exponent; /**/ - - Bias(const T *element, const std::vector channel_exponent, const std::vector shape); }; /** diff --git a/tools/sdk/esp32s2/include/esp-face/include/typedef/dl_variable.hpp b/tools/sdk/esp32s2/include/esp-face/include/typedef/dl_variable.hpp index 471b3028f1a..118f6430575 100644 --- a/tools/sdk/esp32s2/include/esp-face/include/typedef/dl_variable.hpp +++ b/tools/sdk/esp32s2/include/esp-face/include/typedef/dl_variable.hpp @@ -396,9 +396,6 @@ namespace dl * @brief print all the element of the Tensor. * * @param message to print - * @param with_padding one of true or false, - * - true: the padding element will also be ed - * - false: the padding element will not be ed */ void print_all(const char *message = "") { @@ -553,4 +550,4 @@ namespace dl return output; } }; -} // namespace dl \ No newline at end of file +} // namespace dl diff --git a/tools/sdk/esp32s2/include/esp_http_client/include/esp_http_client.h b/tools/sdk/esp32s2/include/esp_http_client/include/esp_http_client.h index 820c4168f66..d1b530a42e3 100644 --- a/tools/sdk/esp32s2/include/esp_http_client/include/esp_http_client.h +++ b/tools/sdk/esp32s2/include/esp_http_client/include/esp_http_client.h @@ -344,6 +344,17 @@ esp_err_t esp_http_client_set_password(esp_http_client_handle_t client, const ch */ esp_err_t esp_http_client_set_authtype(esp_http_client_handle_t client, esp_http_client_auth_type_t auth_type); +/** + * @brief Get HTTP client session errno + * + * @param[in] client The esp_http_client handle + * + * @return + * - (-1) if invalid argument + * - errno + */ +int esp_http_client_get_errno(esp_http_client_handle_t client); + /** * @brief Set http request method * diff --git a/tools/sdk/esp32s2/include/esp_hw_support/include/soc/spinlock.h b/tools/sdk/esp32s2/include/esp_hw_support/include/soc/spinlock.h index 97cc9e514ab..fbeff5054b4 100644 --- a/tools/sdk/esp32s2/include/esp_hw_support/include/soc/spinlock.h +++ b/tools/sdk/esp32s2/include/esp_hw_support/include/soc/spinlock.h @@ -52,6 +52,15 @@ static inline void __attribute__((always_inline)) spinlock_initialize(spinlock_t /** * @brief Top level spinlock acquire function, spins until get the lock + * + * This function will: + * - Save current interrupt state, then disable interrupts + * - Spin until lock is acquired or until timeout occurs + * - Restore interrupt state + * + * @note Spinlocks alone do no constitute true critical sections (as this + * function reenables interrupts once the spinlock is acquired). For critical + * sections, use the interface provided by the operating system. * @param lock - target spinlock object * @param timeout - cycles to wait, passing SPINLOCK_WAIT_FOREVER blocs indefinitely */ @@ -125,6 +134,15 @@ static inline bool __attribute__((always_inline)) spinlock_acquire(spinlock_t *l /** * @brief Top level spinlock unlock function, unlocks a previously locked spinlock + * + * This function will: + * - Save current interrupt state, then disable interrupts + * - Release the spinlock + * - Restore interrupt state + * + * @note Spinlocks alone do no constitute true critical sections (as this + * function reenables interrupts once the spinlock is acquired). For critical + * sections, use the interface provided by the operating system. * @param lock - target, locked before, spinlock object */ static inline void __attribute__((always_inline)) spinlock_release(spinlock_t *lock) diff --git a/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_commands.h b/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_commands.h new file mode 100644 index 00000000000..091ef1cffef --- /dev/null +++ b/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_commands.h @@ -0,0 +1,54 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once + +/* Common LCD panel commands */ +#define LCD_CMD_NOP 0x00 // This command is empty command +#define LCD_CMD_SWRESET 0x01 // Software reset registers (the built-in frame buffer is not affected) +#define LCD_CMD_RDDID 0x04 // Read 24-bit display ID +#define LCD_CMD_RDDST 0x09 // Read display status +#define LCD_CMD_RDDPM 0x0A // Read display power mode +#define LCD_CMD_RDD_MADCTL 0x0B // Read display MADCTL +#define LCD_CMD_RDD_COLMOD 0x0C // Read display pixel format +#define LCD_CMD_RDDIM 0x0D // Read display image mode +#define LCD_CMD_RDDSM 0x0E // Read display signal mode +#define LCD_CMD_RDDSR 0x0F // Read display self-diagnostic result +#define LCD_CMD_SLPIN 0x10 // Go into sleep mode (DC/DC, oscillator, scanning stopped, but memory keeps content) +#define LCD_CMD_SLPOUT 0x11 // Exit sleep mode +#define LCD_CMD_PTLON 0x12 // Turns on partial display mode +#define LCD_CMD_NORON 0x13 // Turns on normal display mode +#define LCD_CMD_INVOFF 0x20 // Recover from display inversion mode +#define LCD_CMD_INVON 0x21 // Go into display inversion mode +#define LCD_CMD_GAMSET 0x26 // Select Gamma curve for current display +#define LCD_CMD_DISPOFF 0x28 // Display off (disable frame buffer output) +#define LCD_CMD_DISPON 0x29 // Display on (enable frame buffer output) +#define LCD_CMD_CASET 0x2A // Set column address +#define LCD_CMD_RASET 0x2B // Set row address +#define LCD_CMD_RAMWR 0x2C // Write frame memory +#define LCD_CMD_RAMRD 0x2E // Read frame memory +#define LCD_CMD_PTLAR 0x30 // Define the partial area +#define LCD_CMD_VSCRDEF 0x33 // Vertical scrolling definition +#define LCD_CMD_TEOFF 0x34 // Turns of tearing effect +#define LCD_CMD_TEON 0x35 // Turns on tearing effect + +#define LCD_CMD_MADCTL 0x36 // Memory data access control +#define LCD_CMD_MH_BIT (1 << 2) // Display data latch order, 0: refresh left to right, 1: refresh right to left +#define LCD_CMD_BGR_BIT (1 << 3) // RGB/BGR order, 0: RGB, 1: BGR +#define LCD_CMD_ML_BIT (1 << 4) // Line address order, 0: refresh top to bottom, 1: refresh bottom to top +#define LCD_CMD_MV_BIT (1 << 5) // Row/Column order, 0: normal mode, 1: reverse mode +#define LCD_CMD_MX_BIT (1 << 6) // Column address order, 0: left to right, 1: right to left +#define LCD_CMD_MY_BIT (1 << 7) // Row address order, 0: top to bottom, 1: bottom to top + +#define LCD_CMD_VSCSAD 0x37 // Vertical scroll start address +#define LCD_CMD_IDMOFF 0x38 // Recover from IDLE mode +#define LCD_CMD_IDMON 0x39 // Fall into IDLE mode (8 color depth is displayed) +#define LCD_CMD_COLMOD 0x3A // Defines the format of RGB picture data +#define LCD_CMD_RAMWRC 0x3C // Memory write continue +#define LCD_CMD_RAMRDC 0x3E // Memory read continue +#define LCD_CMD_STE 0x44 // Set tear scanline, tearing effect output signal when display module reaches line N +#define LCD_CMD_GDCAN 0x45 // Get scanline +#define LCD_CMD_WRDISBV 0x51 // Write display brightness +#define LCD_CMD_RDDISBV 0x52 // Read display brightness value diff --git a/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_rgb.h b/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_rgb.h index 1368bb787f6..0c264545ee2 100644 --- a/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_rgb.h +++ b/tools/sdk/esp32s2/include/esp_lcd/include/esp_lcd_panel_rgb.h @@ -18,10 +18,10 @@ extern "C" { #if SOC_LCD_RGB_SUPPORTED /** * @brief LCD RGB timing structure - * + * @verbatim * Total Width * <---------------------------------------------------> - * Hsync width HBP Active Width HFP + * HSYNC width HBP Active Width HFP * <---><--><--------------------------------------><---> * ____ ____|_______________________________________|____| * |___| | | | @@ -36,7 +36,7 @@ extern "C" { * | /|\ | | / / / / / / / / / / / / / / / / / / / | | * | | | |/ / / / / / / / / / / / / / / / / / / /| | * Total | | | |/ / / / / / / / / / / / / / / / / / / /| | - * Heigh | | | |/ / / / / / / / / / / / / / / / / / / /| | + * Height | | | |/ / / / / / / / / / / / / / / / / / / /| | * |Active| | |/ / / / / / / / / / / / / / / / / / / /| | * |Heigh | | |/ / / / / / Active Display Area / / / /| | * | | | |/ / / / / / / / / / / / / / / / / / / /| | @@ -48,7 +48,7 @@ extern "C" { * | /|\ | | * | VFP | | | * \|/ \|/_____|______________________________________________________| - * + * @endverbatim */ typedef struct { unsigned int pclk_hz; /*!< Frequency of pixel clock */ @@ -65,7 +65,7 @@ typedef struct { unsigned int vsync_idle_low: 1; /*!< The vsync signal is low in IDLE state */ unsigned int de_idle_high: 1; /*!< The de signal is high in IDLE state */ unsigned int pclk_active_neg: 1; /*!< The display will write data lines when there's a falling edge on PCLK */ - unsigned int pclk_idle_low: 1; /*!< The PCLK stays at low level in IDLE phase */ + unsigned int pclk_idle_high: 1; /*!< The PCLK stays at high level in IDLE phase */ } flags; } esp_lcd_rgb_timing_t; diff --git a/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_defaults.h b/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_defaults.h index da01500db1c..b8276068e9a 100644 --- a/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_defaults.h +++ b/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_defaults.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef _ESP_NETIF_DEFAULTS_H #define _ESP_NETIF_DEFAULTS_H @@ -37,6 +29,7 @@ extern "C" { .route_prio = 100 \ } \ +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT #define ESP_NETIF_INHERENT_DEFAULT_WIFI_AP() \ { \ .flags = (esp_netif_flags_t)(ESP_NETIF_DHCP_SERVER | ESP_NETIF_FLAG_AUTOUP), \ @@ -48,6 +41,7 @@ extern "C" { .if_desc = "ap", \ .route_prio = 10 \ }; +#endif #define ESP_NETIF_INHERENT_DEFAULT_ETH() \ { \ @@ -108,6 +102,7 @@ extern "C" { .stack = ESP_NETIF_NETSTACK_DEFAULT_ETH, \ } +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT /** * @brief Default configuration reference of WIFI AP */ @@ -117,6 +112,7 @@ extern "C" { .driver = NULL, \ .stack = ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP, \ } +#endif /** * @brief Default configuration reference of WIFI STA @@ -154,10 +150,12 @@ extern "C" { */ #define ESP_NETIF_BASE_DEFAULT_WIFI_STA &_g_esp_netif_inherent_sta_config +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT /** * @brief Default base config (esp-netif inherent) of WIFI AP */ #define ESP_NETIF_BASE_DEFAULT_WIFI_AP &_g_esp_netif_inherent_ap_config +#endif /** * @brief Default base config (esp-netif inherent) of ethernet interface @@ -177,7 +175,9 @@ extern "C" { #define ESP_NETIF_NETSTACK_DEFAULT_ETH _g_esp_netif_netstack_default_eth #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_STA _g_esp_netif_netstack_default_wifi_sta +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT #define ESP_NETIF_NETSTACK_DEFAULT_WIFI_AP _g_esp_netif_netstack_default_wifi_ap +#endif #define ESP_NETIF_NETSTACK_DEFAULT_PPP _g_esp_netif_netstack_default_ppp #define ESP_NETIF_NETSTACK_DEFAULT_SLIP _g_esp_netif_netstack_default_slip #define ESP_NETIF_NETSTACK_DEFAULT_OPENTHREAD _g_esp_netif_netstack_default_openthread @@ -190,7 +190,9 @@ extern "C" { // extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_eth; extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_sta; +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_wifi_ap; +#endif extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_ppp; extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_slip; @@ -200,12 +202,16 @@ extern const esp_netif_netstack_config_t *_g_esp_netif_netstack_default_slip; // common behavioural patterns for common interfaces such as STA, AP, ETH, PPP // extern const esp_netif_inherent_config_t _g_esp_netif_inherent_sta_config; +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ap_config; +#endif extern const esp_netif_inherent_config_t _g_esp_netif_inherent_eth_config; extern const esp_netif_inherent_config_t _g_esp_netif_inherent_ppp_config; extern const esp_netif_inherent_config_t _g_esp_netif_inherent_slip_config; +#ifdef CONFIG_ESP_WIFI_SOFTAP_SUPPORT extern const esp_netif_ip_info_t _g_esp_netif_soft_ap_ip; +#endif #if CONFIG_OPENTHREAD_ENABLED /** diff --git a/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_types.h b/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_types.h index b302e49e3ad..cc7a37b9c49 100644 --- a/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_types.h +++ b/tools/sdk/esp32s2/include/esp_netif/include/esp_netif_types.h @@ -79,6 +79,8 @@ typedef enum{ ESP_NETIF_REQUESTED_IP_ADDRESS = 50, /**< Request specific IP address */ ESP_NETIF_IP_ADDRESS_LEASE_TIME = 51, /**< Request IP address lease time */ ESP_NETIF_IP_REQUEST_RETRY_TIME = 52, /**< Request IP address retry counter */ + ESP_NETIF_VENDOR_CLASS_IDENTIFIER = 60, /**< Vendor Class Identifier of a DHCP client */ + ESP_NETIF_VENDOR_SPECIFIC_INFO = 43, /**< Vendor Specific Information of a DHCP server */ } esp_netif_dhcp_option_id_t; /** IP event declarations */ diff --git a/tools/sdk/esp32s2/include/esp_phy/include/phy.h b/tools/sdk/esp32s2/include/esp_phy/include/phy.h index 1d0690f3562..e6aa21db50e 100644 --- a/tools/sdk/esp32s2/include/esp_phy/include/phy.h +++ b/tools/sdk/esp32s2/include/esp_phy/include/phy.h @@ -68,6 +68,13 @@ void phy_close_rf(void); void phy_xpd_tsens(void); #endif +#if CONFIG_IDF_TARGET_ESP32C3 +/** + * @brief Update internal state of PHY when wifi deinit powers off the wifi power domain. + */ +void phy_init_flag(void); +#endif + /** * @brief Store and load PHY digital registers. * diff --git a/tools/sdk/esp32s2/include/esp_timer/include/esp_timer.h b/tools/sdk/esp32s2/include/esp_timer/include/esp_timer.h index 8c942989477..eb4c6d707ab 100644 --- a/tools/sdk/esp32s2/include/esp_timer/include/esp_timer.h +++ b/tools/sdk/esp32s2/include/esp_timer/include/esp_timer.h @@ -1,16 +1,8 @@ -// Copyright 2017 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -83,11 +75,28 @@ typedef struct { bool skip_unhandled_events; //!< Skip unhandled events for periodic timers } esp_timer_create_args_t; + +/** + * @brief Minimal initialization of esp_timer + * + * @note This function is called from startup code. Applications do not need + * to call this function before using other esp_timer APIs. + * + * This function can be called very early in startup process, after this call + * only esp_timer_get_time function can be used. + * + * @return + * - ESP_OK on success + */ +esp_err_t esp_timer_early_init(void); + /** * @brief Initialize esp_timer library * * @note This function is called from startup code. Applications do not need * to call this function before using other esp_timer APIs. + * Before calling this function, esp_timer_early_init must be called by the + * startup code. * * @return * - ESP_OK on success diff --git a/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi_os_adapter.h b/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi_os_adapter.h index b583e916267..88d0ee54029 100644 --- a/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi_os_adapter.h +++ b/tools/sdk/esp32s2/include/esp_wifi/include/esp_private/wifi_os_adapter.h @@ -1,16 +1,8 @@ -// Copyright 2018 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef ESP_WIFI_OS_ADAPTER_H_ #define ESP_WIFI_OS_ADAPTER_H_ diff --git a/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi.h b/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi.h index 51e03234841..2d671591765 100644 --- a/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi.h +++ b/tools/sdk/esp32s2/include/esp_wifi/include/esp_wifi.h @@ -1,16 +1,8 @@ -// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ /* Notes about WiFi Programming @@ -275,7 +267,7 @@ esp_err_t esp_wifi_deinit(void); * @brief Set the WiFi operating mode * * Set the WiFi operating mode as station, soft-AP or station+soft-AP, - * The default mode is soft-AP mode. + * The default mode is station mode. * * @param mode WiFi operating mode * diff --git a/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h b/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h index 675af141ebc..aa87e1b4db2 100644 --- a/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h +++ b/tools/sdk/esp32s2/include/freertos/include/esp_additions/freertos/FreeRTOSConfig.h @@ -166,10 +166,19 @@ #define configSTACK_OVERHEAD_APPTRACE 0 #endif +/* Stack watchpoint decreases minimum usable stack size by up to 60 bytes. + See FreeRTOS FREERTOS_WATCHPOINT_END_OF_STACK option in Kconfig. */ +#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK +#define configSTACK_OVERHEAD_WATCHPOINT 60 +#else +#define configSTACK_OVERHEAD_WATCHPOINT 0 +#endif + #define configSTACK_OVERHEAD_TOTAL ( \ configSTACK_OVERHEAD_CHECKER + \ configSTACK_OVERHEAD_OPTIMIZATION + \ - configSTACK_OVERHEAD_APPTRACE \ + configSTACK_OVERHEAD_APPTRACE + \ + configSTACK_OVERHEAD_WATCHPOINT \ ) #define configMINIMAL_STACK_SIZE (768 + configSTACK_OVERHEAD_TOTAL) diff --git a/tools/sdk/esp32s2/include/freertos/port/xtensa/include/freertos/portmacro.h b/tools/sdk/esp32s2/include/freertos/port/xtensa/include/freertos/portmacro.h index 47187379c6c..934f056816c 100644 --- a/tools/sdk/esp32s2/include/freertos/port/xtensa/include/freertos/portmacro.h +++ b/tools/sdk/esp32s2/include/freertos/port/xtensa/include/freertos/portmacro.h @@ -155,15 +155,20 @@ void vPortAssertIfInISR(void); BaseType_t xPortInterruptedFromISRContext(void); /** - * @brief Disable interrupts in a nested manner + * @brief Disable interrupts in a nested manner (meant to be called from ISRs) * - * - Cleaner solution allows nested interrupts disabling and restoring via local registers or stack. - * - They can be called from interrupts too. - * - WARNING Only applies to current CPU. - * @note [refactor-todo] Define this as portSET_INTERRUPT_MASK_FROM_ISR() instead - * @return unsigned Previous interrupt state + * @warning Only applies to current CPU. + * @return UBaseType_t Previous interrupt level */ -static inline unsigned __attribute__((always_inline)) portENTER_CRITICAL_NESTED(void); +static inline UBaseType_t xPortSetInterruptMaskFromISR(void); + +/** + * @brief Reenable interrupts in a nested manner (meant to be called from ISRs) + * + * @warning Only applies to current CPU. + * @param prev_level Previous interrupt level + */ +static inline void vPortClearInterruptMaskFromISR(UBaseType_t prev_level); /* ---------------------- Spinlocks ------------------------ * - Modifications made to critical sections to support SMP @@ -174,128 +179,112 @@ static inline unsigned __attribute__((always_inline)) portENTER_CRITICAL_NESTED( * @note [refactor-todo] Check if these comments are still true * ------------------------------------------------------ */ -typedef spinlock_t portMUX_TYPE; /**< Spinlock type used by FreeRTOS critical sections */ -#define portMUX_INITIALIZER_UNLOCKED SPINLOCK_INITIALIZER /**< Spinlock initializer */ -#define portMUX_FREE_VAL SPINLOCK_FREE /**< Spinlock is free. [refactor-todo] check if this is still required */ -#define portMUX_NO_TIMEOUT SPINLOCK_WAIT_FOREVER /**< When passed for 'timeout_cycles', spin forever if necessary. [refactor-todo] check if this is still required */ -#define portMUX_TRY_LOCK SPINLOCK_NO_WAIT /**< Try to acquire the spinlock a single time only. [refactor-todo] check if this is still required */ +typedef spinlock_t portMUX_TYPE; /**< Spinlock type used by FreeRTOS critical sections */ +#define portMUX_INITIALIZER_UNLOCKED SPINLOCK_INITIALIZER /**< Spinlock initializer */ +#define portMUX_FREE_VAL SPINLOCK_FREE /**< Spinlock is free. [refactor-todo] check if this is still required */ +#define portMUX_NO_TIMEOUT SPINLOCK_WAIT_FOREVER /**< When passed for 'timeout_cycles', spin forever if necessary. [refactor-todo] check if this is still required */ +#define portMUX_TRY_LOCK SPINLOCK_NO_WAIT /**< Try to acquire the spinlock a single time only. [refactor-todo] check if this is still required */ +#define portMUX_INITIALIZE(mux) spinlock_initialize(mux) /*< Initialize a spinlock to its unlocked state */ -/** - * @brief Initialize a spinlock - * - * - Initializes a spinlock that is used by FreeRTOS SMP critical sections - * - * @param[in] mux Spinlock - */ -static inline void __attribute__((always_inline)) vPortCPUInitializeMutex(portMUX_TYPE *mux); +// ------------------ Critical Sections -------------------- /** - * @brief Acquire a spinlock + * @brief Enter a SMP critical section with a timeout * - * @note [refactor-todo] check if we still need this - * - * @param[in] mux Spinlock - */ -static inline void __attribute__((always_inline)) vPortCPUAcquireMutex(portMUX_TYPE *mux); - -/** - * @brief Acquire a spinlock but with a specified timeout + * This function enters an SMP critical section by disabling interrupts then + * taking a spinlock with a specified timeout. * - * @note [refactor-todo] check if we still need this - * @note [refactor-todo] Check if this function should be renamed (due to bool return type) + * This function can be called in a nested manner. * - * @param[in] mux Spinlock - * @param timeout - * @return true Spinlock acquired - * @return false Timed out + * @note This function is made non-inline on purpose to reduce code size + * @param mux Spinlock + * @param timeout Timeout to wait for spinlock in number of CPU cycles. + * Use portMUX_NO_TIMEOUT to wait indefinitely + * Use portMUX_TRY_LOCK to only getting the spinlock a single time + * @retval pdPASS Critical section entered (spinlock taken) + * @retval pdFAIL If timed out waiting for spinlock (will not occur if using portMUX_NO_TIMEOUT) */ -static inline bool __attribute__((always_inline)) vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout); +BaseType_t xPortEnterCriticalTimeout(portMUX_TYPE *mux, BaseType_t timeout); /** - * @brief Release a spinlock + * @brief Enter a SMP critical section + * + * This function enters an SMP critical section by disabling interrupts then + * taking a spinlock with an unlimited timeout. * - * @note [refactor-todo] check if we still need this + * This function can be called in a nested manner * * @param[in] mux Spinlock */ -static inline void __attribute__((always_inline)) vPortCPUReleaseMutex(portMUX_TYPE *mux); +static inline void __attribute__((always_inline)) vPortEnterCritical(portMUX_TYPE *mux); /** - * @brief Wrapper for atomic compare-and-set instruction + * @brief Exit a SMP critical section * - * This subroutine will atomically compare *addr to 'compare'. If *addr == compare, *addr is set to *set. *set is - * updated with the previous value of *addr (either 'compare' or some other value.) + * This function can be called in a nested manner. On the outer most level of nesting, this function will: * - * @warning From the ISA docs: in some (unspecified) cases, the s32c1i instruction may return the "bitwise inverse" of - * the old mem if the mem wasn't written. This doesn't seem to happen on the ESP32 (portMUX assertions would - * fail). + * - Release the spinlock + * - Restore the previous interrupt level before the critical section was entered * - * @note [refactor-todo] check if we still need this - * @note [refactor-todo] Check if this function should be renamed (due to void return type) + * If still nesting, this function simply decrements a critical nesting count * - * @param[inout] addr Pointer to target address - * @param[in] compare Compare value - * @param[inout] set Pointer to set value + * @note This function is made non-inline on purpose to reduce code size + * @param[in] mux Spinlock */ -static inline void __attribute__((always_inline)) uxPortCompareSet(volatile uint32_t *addr, uint32_t compare, uint32_t *set); +void vPortExitCritical(portMUX_TYPE *mux); /** - * @brief Wrapper for atomic compare-and-set instruction in external RAM + * @brief FreeRTOS Compliant version of xPortEnterCriticalTimeout() * - * Atomic compare-and-set but the target address is placed in external RAM + * Compliant version of xPortEnterCriticalTimeout() will ensure that this is + * called from a task context only. An abort is called otherwise. * - * @note [refactor-todo] check if we still need this + * @note This function is made non-inline on purpose to reduce code size * - * @param[inout] addr Pointer to target address - * @param[in] compare Compare value - * @param[inout] set Pointer to set value + * @param mux Spinlock + * @param timeout Timeout + * @return BaseType_t */ -static inline void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set); - -// ------------------ Critical Sections -------------------- +BaseType_t xPortEnterCriticalTimeoutCompliance(portMUX_TYPE *mux, BaseType_t timeout); /** - * @brief Enter a SMP critical section + * @brief FreeRTOS compliant version of vPortEnterCritical() * - * - Disable interrupts - * - Takes spinlock - * - Can be nested + * Compliant version of vPortEnterCritical() will ensure that this is + * called from a task context only. An abort is called otherwise. * * @param[in] mux Spinlock */ -void vPortEnterCritical(portMUX_TYPE *mux); +static inline void __attribute__((always_inline)) vPortEnterCriticalCompliance(portMUX_TYPE *mux); /** - * @brief Exit a SMP critical section + * @brief FreeRTOS compliant version of vPortExitCritical() * - * - Releases spinlock - * - Reenables interrupts - * - Can be nested + * Compliant version of vPortExitCritical() will ensure that this is + * called from a task context only. An abort is called otherwise. * + * @note This function is made non-inline on purpose to reduce code size * @param[in] mux Spinlock */ -void vPortExitCritical(portMUX_TYPE *mux); +void vPortExitCriticalCompliance(portMUX_TYPE *mux); /** - * @brief FreeRTOS compliant version of enter critical - * - * - Ensures that critical section is only entered from task context + * @brief Safe version of enter critical timeout * - * @param[in] mux Spinlock - */ -static inline void __attribute__((always_inline)) vPortEnterCriticalCompliance(portMUX_TYPE *mux); - -/** - * @brief FreeRTOS compliant version of exit critical + * Safe version of enter critical will automatically select between + * portTRY_ENTER_CRITICAL() and portTRY_ENTER_CRITICAL_ISR() * - * @param[in] mux Spinlock + * @param mux Spinlock + * @param timeout Timeout + * @return BaseType_t */ -static inline void __attribute__((always_inline)) vPortExitCriticalCompliance(portMUX_TYPE *mux); +static inline BaseType_t __attribute__((always_inline)) xPortEnterCriticalTimeoutSafe(portMUX_TYPE *mux, BaseType_t timeout); /** * @brief Safe version of enter critical * - * - This function can be used to enter a critical section from both task and ISR contexts + * Safe version of enter critical will automatically select between + * portENTER_CRITICAL() and portENTER_CRITICAL_ISR() * * @param[in] mux Spinlock */ @@ -304,6 +293,9 @@ static inline void __attribute__((always_inline)) vPortEnterCriticalSafe(portMUX /** * @brief Safe version of exit critical * + * Safe version of enter critical will automatically select between + * portEXIT_CRITICAL() and portEXIT_CRITICAL_ISR() + * * @param[in] mux Spinlock */ static inline void __attribute__((always_inline)) vPortExitCriticalSafe(portMUX_TYPE *mux); @@ -392,6 +384,38 @@ void vPortSetStackWatchpoint( void *pxStackStart ); */ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void); +/** + * @brief Wrapper for atomic compare-and-set instruction + * + * This subroutine will atomically compare *addr to 'compare'. If *addr == compare, *addr is set to *set. *set is + * updated with the previous value of *addr (either 'compare' or some other value.) + * + * @warning From the ISA docs: in some (unspecified) cases, the s32c1i instruction may return the "bitwise inverse" of + * the old mem if the mem wasn't written. This doesn't seem to happen on the ESP32 (portMUX assertions would + * fail). + * + * @note [refactor-todo] Check if this can be deprecated + * @note [refactor-todo] Check if this function should be renamed (due to void return type) + * + * @param[inout] addr Pointer to target address + * @param[in] compare Compare value + * @param[inout] set Pointer to set value + */ +static inline void __attribute__((always_inline)) uxPortCompareSet(volatile uint32_t *addr, uint32_t compare, uint32_t *set); + +/** + * @brief Wrapper for atomic compare-and-set instruction in external RAM + * + * Atomic compare-and-set but the target address is placed in external RAM + * + * @note [refactor-todo] Check if this can be deprecated + * + * @param[inout] addr Pointer to target address + * @param[in] compare Compare value + * @param[inout] set Pointer to set value + */ +static inline void __attribute__((always_inline)) uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set); + /* ------------------------------------------- FreeRTOS Porting Interface ---------------------------------------------- @@ -416,8 +440,6 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void); // --------------------- Interrupts ------------------------ -#define portEXIT_CRITICAL_NESTED(state) do { portbenchmarkINTERRUPT_RESTORE(state); XTOS_RESTORE_JUST_INTLEVEL(state); } while (0) - /** * - Only applies to current core * - These cannot be nested. They should be used with a lot of care and cannot be called from interrupt level. @@ -430,8 +452,8 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void); /** * ISR versions to enable/disable interrupts */ -#define portSET_INTERRUPT_MASK_FROM_ISR() portENTER_CRITICAL_NESTED() -#define portCLEAR_INTERRUPT_MASK_FROM_ISR(state) portEXIT_CRITICAL_NESTED(state) +#define portSET_INTERRUPT_MASK_FROM_ISR() xPortSetInterruptMaskFromISR() +#define portCLEAR_INTERRUPT_MASK_FROM_ISR(prev_level) vPortClearInterruptMaskFromISR(prev_level) #define portASSERT_IF_IN_ISR() vPortAssertIfInISR() @@ -446,16 +468,22 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void); * - Safe versions can be called from either contexts */ #ifdef CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE -#define portENTER_CRITICAL(mux) vPortEnterCriticalCompliance(mux) -#define portEXIT_CRITICAL(mux) vPortExitCriticalCompliance(mux) +#define portTRY_ENTER_CRITICAL(mux, timeout) xPortEnterCriticalTimeoutCompliance(mux, timeout) +#define portENTER_CRITICAL(mux) vPortEnterCriticalCompliance(mux) +#define portEXIT_CRITICAL(mux) vPortExitCriticalCompliance(mux) #else -#define portENTER_CRITICAL(mux) vPortEnterCritical(mux) -#define portEXIT_CRITICAL(mux) vPortExitCritical(mux) +#define portTRY_ENTER_CRITICAL(mux, timeout) xPortEnterCriticalTimeout(mux, timeout) +#define portENTER_CRITICAL(mux) vPortEnterCritical(mux) +#define portEXIT_CRITICAL(mux) vPortExitCritical(mux) #endif /* CONFIG_FREERTOS_CHECK_PORT_CRITICAL_COMPLIANCE */ -#define portENTER_CRITICAL_ISR(mux) vPortEnterCritical(mux) -#define portEXIT_CRITICAL_ISR(mux) vPortExitCritical(mux) -#define portENTER_CRITICAL_SAFE(mux) vPortEnterCriticalSafe(mux) -#define portEXIT_CRITICAL_SAFE(mux) vPortExitCriticalSafe(mux) + +#define portTRY_ENTER_CRITICAL_ISR(mux, timeout) xPortEnterCriticalTimeout(mux, timeout) +#define portENTER_CRITICAL_ISR(mux) vPortEnterCritical(mux) +#define portEXIT_CRITICAL_ISR(mux) vPortExitCritical(mux) + +#define portTRY_ENTER_CRITICAL_SAFE(mux, timeout) xPortEnterCriticalTimeoutSafe(mux) +#define portENTER_CRITICAL_SAFE(mux) vPortEnterCriticalSafe(mux) +#define portEXIT_CRITICAL_SAFE(mux) vPortExitCriticalSafe(mux) // ---------------------- Yielding ------------------------- @@ -530,78 +558,45 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void); // --------------------- Interrupts ------------------------ -static inline unsigned portENTER_CRITICAL_NESTED(void) +static inline UBaseType_t xPortSetInterruptMaskFromISR(void) { - unsigned state = XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL); + UBaseType_t prev_int_level = XTOS_SET_INTLEVEL(XCHAL_EXCM_LEVEL); portbenchmarkINTERRUPT_DISABLE(); - return state; -} - -// ---------------------- Spinlocks ------------------------ - -static inline void __attribute__((always_inline)) vPortCPUInitializeMutex(portMUX_TYPE *mux) -{ - spinlock_initialize(mux); -} - -static inline void __attribute__((always_inline)) vPortCPUAcquireMutex(portMUX_TYPE *mux) -{ - spinlock_acquire(mux, portMUX_NO_TIMEOUT); + return prev_int_level; } -static inline bool __attribute__((always_inline)) vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout) +static inline void vPortClearInterruptMaskFromISR(UBaseType_t prev_level) { - return (spinlock_acquire(mux, timeout)); + portbenchmarkINTERRUPT_RESTORE(prev_level); + XTOS_RESTORE_JUST_INTLEVEL(prev_level); } -static inline void __attribute__((always_inline)) vPortCPUReleaseMutex(portMUX_TYPE *mux) -{ - spinlock_release(mux); -} - -static inline void __attribute__((always_inline)) uxPortCompareSet(volatile uint32_t *addr, uint32_t compare, uint32_t *set) -{ - compare_and_set_native(addr, compare, set); -} +// ------------------ Critical Sections -------------------- -static inline void uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set) +static inline void __attribute__((always_inline)) vPortEnterCritical(portMUX_TYPE *mux) { -#ifdef CONFIG_SPIRAM - compare_and_set_extram(addr, compare, set); -#endif + xPortEnterCriticalTimeout(mux, portMUX_NO_TIMEOUT); } -// ------------------ Critical Sections -------------------- - static inline void __attribute__((always_inline)) vPortEnterCriticalCompliance(portMUX_TYPE *mux) { - if (!xPortInIsrContext()) { - vPortEnterCritical(mux); - } else { - esp_rom_printf("%s:%d (%s)- port*_CRITICAL called from ISR context!\n", - __FILE__, __LINE__, __FUNCTION__); - abort(); - } + xPortEnterCriticalTimeoutCompliance(mux, portMUX_NO_TIMEOUT); } -static inline void __attribute__((always_inline)) vPortExitCriticalCompliance(portMUX_TYPE *mux) +static inline BaseType_t __attribute__((always_inline)) xPortEnterCriticalTimeoutSafe(portMUX_TYPE *mux, BaseType_t timeout) { - if (!xPortInIsrContext()) { - vPortExitCritical(mux); + BaseType_t ret; + if (xPortInIsrContext()) { + ret = portTRY_ENTER_CRITICAL_ISR(mux, timeout); } else { - esp_rom_printf("%s:%d (%s)- port*_CRITICAL called from ISR context!\n", - __FILE__, __LINE__, __FUNCTION__); - abort(); + ret = portTRY_ENTER_CRITICAL(mux, timeout); } + return ret; } static inline void __attribute__((always_inline)) vPortEnterCriticalSafe(portMUX_TYPE *mux) { - if (xPortInIsrContext()) { - portENTER_CRITICAL_ISR(mux); - } else { - portENTER_CRITICAL(mux); - } + xPortEnterCriticalTimeoutSafe(mux, portMUX_NO_TIMEOUT); } static inline void __attribute__((always_inline)) vPortExitCriticalSafe(portMUX_TYPE *mux) @@ -639,6 +634,18 @@ static inline BaseType_t IRAM_ATTR xPortGetCoreID(void) return (uint32_t) cpu_hal_get_core_id(); } +static inline void __attribute__((always_inline)) uxPortCompareSet(volatile uint32_t *addr, uint32_t compare, uint32_t *set) +{ + compare_and_set_native(addr, compare, set); +} + +static inline void __attribute__((always_inline)) uxPortCompareSetExtram(volatile uint32_t *addr, uint32_t compare, uint32_t *set) +{ +#ifdef CONFIG_SPIRAM + compare_and_set_extram(addr, compare, set); +#endif +} + /* ------------------------------------------------------ Misc --------------------------------------------------------- @@ -737,6 +744,14 @@ bool xPortcheckValidStackMem(const void *ptr); #define portVALID_TCB_MEM(ptr) xPortCheckValidTCBMem(ptr) #define portVALID_STACK_MEM(ptr) xPortcheckValidStackMem(ptr) + + +/* ---------------------------------------------------- Deprecate ------------------------------------------------------ + * - Pull in header containing deprecated macros here + * ------------------------------------------------------------------------------------------------------------------ */ + +#include "portmacro_deprecated.h" + #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/freertos/port/xtensa/include/freertos/portmacro_deprecated.h b/tools/sdk/esp32s2/include/freertos/port/xtensa/include/freertos/portmacro_deprecated.h new file mode 100644 index 00000000000..378617c73aa --- /dev/null +++ b/tools/sdk/esp32s2/include/freertos/port/xtensa/include/freertos/portmacro_deprecated.h @@ -0,0 +1,93 @@ +/* + * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/* ---------------------------------------------------- Deprecate ------------------------------------------------------ + * - Macros or functions that should be deprecated in v5.0, then removed in the next major release + * - Kept as not to cause a breaking change + * - Include this header at the end of portmacro.h + * ------------------------------------------------------------------------------------------------------------------ */ + +/** + * @brief Disable interrupts in a nested manner + * + * Does the exact same thing as portSET_INTERRUPT_MASK_FROM_ISR() + * + * @deprecated This function is deprecated. Call portSET_INTERRUPT_MASK_FROM_ISR() instead + */ +static inline __attribute__((deprecated)) UBaseType_t portENTER_CRITICAL_NESTED(void) { + return portSET_INTERRUPT_MASK_FROM_ISR(); +} + +/** + * @brief Reenables interrupts in a nested manner + * + * Does the exact same thing as portCLEAR_INTERRUPT_MASK_FROM_ISR() + * + * @deprecated This function is deprecated. Call portCLEAR_INTERRUPT_MASK_FROM_ISR() instead + */ +static inline void __attribute__((deprecated)) portEXIT_CRITICAL_NESTED(UBaseType_t prev_level) +{ + portCLEAR_INTERRUPT_MASK_FROM_ISR(prev_level); +} + +/* ---------------------- Spinlocks --------------------- */ + +/** + * @brief Initialize a spinlock + * + * Does the exact same thing as spinlock_initialize(); + * + * @deprecated This function is deprecated. Call spinlock_initialize() instead + * @param[in] mux Spinlock + */ +static inline void __attribute__((deprecated)) __attribute__((always_inline)) vPortCPUInitializeMutex(portMUX_TYPE *mux) +{ + spinlock_initialize(mux); +} + +/** + * @brief Acquire a spinlock + * + * Does the exact same thing as spinlock_acquire() with unlimited timeout + * + * @deprecated This function is deprecated. Call spinlock_acquire() instead + * @param[in] mux Spinlock + */ +static inline void __attribute__((deprecated)) __attribute__((always_inline)) vPortCPUAcquireMutex(portMUX_TYPE *mux) +{ + spinlock_acquire(mux, portMUX_NO_TIMEOUT); +} + +/** + * @brief Acquire a spinlock + * + * Does the exact same thing as spinlock_acquire() with a specified timeout + * + * @deprecated This function is deprecated. Call spinlock_acquire() instead + * @note Does not have deprecated attribute due to usage in app_trace_util.c + * @param[in] mux Spinlock + * @param timeout + * @return true Spinlock acquired + * @return false Timed out + */ +static inline bool __attribute__((always_inline)) vPortCPUAcquireMutexTimeout(portMUX_TYPE *mux, int timeout) +{ + return (spinlock_acquire(mux, timeout)); +} + +/** + * @brief Release a spinlock + * + * Does the exact same thing as spinlock_release() + * + * @deprecated This function is deprecated. Call spinlock_release() instead + * @note Does not have deprecated attribute due to usage in app_trace_util.c + * @param[in] mux Spinlock + */ +static inline void __attribute__((always_inline)) vPortCPUReleaseMutex(portMUX_TYPE *mux) +{ + spinlock_release(mux); +} diff --git a/tools/sdk/esp32s2/include/hal/include/hal/lcd_types.h b/tools/sdk/esp32s2/include/hal/include/hal/lcd_types.h index 01e6d0c2949..1a62d8f8eb4 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/lcd_types.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/lcd_types.h @@ -13,12 +13,17 @@ extern "C" { /** * @brief LCD clock source * @note User should select the clock source based on the real requirement: - * - * | LCD clock source | Features | Power Management | - * |---------------------|--------------------------|----------------------------| - * | LCD_CLK_SRC_PLL160M | High resolution, fixed | ESP_PM_APB_FREQ_MAX lock | - * | LCD_CLK_SRC_APLL | Configurable resolution | ESP_PM_NO_LIGHT_SLEEP lock | - * | LCD_CLK_SRC_XTAL | Medium resolution, fixed | No PM lock | + * @verbatim embed:rst:leading-asterisk + * +---------------------+-------------------------+----------------------------+ + * | LCD clock source | Features | Power Management | + * +=====================+=========================+============================+ + * | LCD_CLK_SRC_PLL160M | High resolution | ESP_PM_APB_FREQ_MAX lock | + * +---------------------+-------------------------+----------------------------+ + * | LCD_CLK_SRC_APLL | Configurable resolution | ESP_PM_NO_LIGHT_SLEEP lock | + * +---------------------+-------------------------+----------------------------+ + * | LCD_CLK_SRC_XTAL | Medium resolution | No PM lock | + * +---------------------+-------------------------+----------------------------+ + * @endverbatim */ typedef enum { LCD_CLK_SRC_PLL160M, /*!< Select PLL160M as the source clock */ diff --git a/tools/sdk/esp32s2/include/hal/include/hal/usbh_hal.h b/tools/sdk/esp32s2/include/hal/include/hal/usbh_hal.h index b315f6c0b14..6360f7b3f36 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/usbh_hal.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/usbh_hal.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -50,17 +42,6 @@ typedef struct { uint32_t ptx_fifo_lines; /**< Size of the Periodic FIFO in terms the number of FIFO lines */ } usbh_hal_fifo_config_t; -// --------------------- HAL States ------------------------ - -/** - * @brief Channel states - */ -typedef enum { - USBH_HAL_CHAN_STATE_HALTED = 0, /**< The channel is halted. No transfer descriptor list is being executed */ - USBH_HAL_CHAN_STATE_ACTIVE, /**< The channel is active. A transfer descriptor list is being executed */ - USBH_HAL_CHAN_STATE_ERROR, /**< The channel is in the error state */ -} usbh_hal_chan_state_t; - // --------------------- HAL Events ------------------------ /** @@ -153,8 +134,7 @@ typedef struct { struct { uint32_t active: 1; /**< Debugging bit to indicate whether channel is enabled */ uint32_t halt_requested: 1; /**< A halt has been requested */ - uint32_t error_pending: 1; /**< The channel is waiting for the error to be handled */ - uint32_t reserved: 1; + uint32_t reserved: 2; uint32_t chan_idx: 4; /**< The index number of the channel */ uint32_t reserved24: 24; }; @@ -556,23 +536,6 @@ static inline void *usbh_hal_chan_get_context(usbh_hal_chan_t *chan_obj) return chan_obj->chan_ctx; } -/** - * @brief Get the current state of a channel - * - * @param chan_obj Channel object - * @return usbh_hal_chan_state_t State of the channel - */ -static inline usbh_hal_chan_state_t usbh_hal_chan_get_state(usbh_hal_chan_t *chan_obj) -{ - if (chan_obj->flags.error_pending) { - return USBH_HAL_CHAN_STATE_ERROR; - } else if (chan_obj->flags.active) { - return USBH_HAL_CHAN_STATE_ACTIVE; - } else { - return USBH_HAL_CHAN_STATE_HALTED; - } -} - /** * @brief Set the endpoint information for a particular channel * @@ -602,7 +565,7 @@ void usbh_hal_chan_set_ep_char(usbh_hal_context_t *hal, usbh_hal_chan_t *chan_ob static inline void usbh_hal_chan_set_dir(usbh_hal_chan_t *chan_obj, bool is_in) { //Cannot change direction whilst channel is still active or in error - HAL_ASSERT(!chan_obj->flags.active && !chan_obj->flags.error_pending); + HAL_ASSERT(!chan_obj->flags.active); usbh_ll_chan_set_dir(chan_obj->regs, is_in); } @@ -621,7 +584,7 @@ static inline void usbh_hal_chan_set_dir(usbh_hal_chan_t *chan_obj, bool is_in) static inline void usbh_hal_chan_set_pid(usbh_hal_chan_t *chan_obj, int pid) { //Cannot change pid whilst channel is still active or in error - HAL_ASSERT(!chan_obj->flags.active && !chan_obj->flags.error_pending); + HAL_ASSERT(!chan_obj->flags.active); //Update channel object and set the register usbh_ll_chan_set_pid(chan_obj->regs, pid); } @@ -638,7 +601,7 @@ static inline void usbh_hal_chan_set_pid(usbh_hal_chan_t *chan_obj, int pid) */ static inline uint32_t usbh_hal_chan_get_pid(usbh_hal_chan_t *chan_obj) { - HAL_ASSERT(!chan_obj->flags.active && !chan_obj->flags.error_pending); + HAL_ASSERT(!chan_obj->flags.active); return usbh_ll_chan_get_pid(chan_obj->regs); } @@ -688,27 +651,33 @@ static inline int usbh_hal_chan_get_qtd_idx(usbh_hal_chan_t *chan_obj) bool usbh_hal_chan_request_halt(usbh_hal_chan_t *chan_obj); /** - * @brief Get a channel's error + * @brief Indicate that a channel is halted after a port error + * + * When a port error occurs (e.g., discconect, overcurrent): + * - Any previously active channels will remain active (i.e., they will not receive a channel interrupt) + * - Attempting to disable them using usbh_hal_chan_request_halt() will NOT generate an interrupt for ISOC channels + * (probalby something to do with the periodic scheduling) + * + * However, the channel's enable bit can be left as 1 since after a port error, a soft reset will be done anyways. + * This function simply updates the channels internal state variable to indicate it is halted (thus allowing it to be + * freed). * * @param chan_obj Channel object - * @return usbh_hal_chan_error_t The type of error the channel has encountered */ -static inline usbh_hal_chan_error_t usbh_hal_chan_get_error(usbh_hal_chan_t *chan_obj) +static inline void usbh_hal_chan_mark_halted(usbh_hal_chan_t *chan_obj) { - HAL_ASSERT(chan_obj->flags.error_pending); - return chan_obj->error; + chan_obj->flags.active = 0; } /** - * @brief Clear a channel of it's error + * @brief Get a channel's error * * @param chan_obj Channel object + * @return usbh_hal_chan_error_t The type of error the channel has encountered */ -static inline void usbh_hal_chan_clear_error(usbh_hal_chan_t *chan_obj) +static inline usbh_hal_chan_error_t usbh_hal_chan_get_error(usbh_hal_chan_t *chan_obj) { - //Can only clear error when an error has occurred - HAL_ASSERT(chan_obj->flags.error_pending); - chan_obj->flags.error_pending = 0; + return chan_obj->error; } // -------------------------------------------- Transfer Descriptor List ----------------------------------------------- diff --git a/tools/sdk/esp32s2/include/hal/include/hal/usbh_ll.h b/tools/sdk/esp32s2/include/hal/include/hal/usbh_ll.h index a6c03e302a4..63f7b8219d1 100644 --- a/tools/sdk/esp32s2/include/hal/include/hal/usbh_ll.h +++ b/tools/sdk/esp32s2/include/hal/include/hal/usbh_ll.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -23,6 +15,8 @@ extern "C" { #include "soc/usbh_struct.h" #include "soc/usb_wrap_struct.h" #include "hal/usb_types_private.h" +#include "hal/misc.h" + /* ----------------------------------------------------------------------------- ------------------------------- Global Registers ------------------------------- @@ -328,7 +322,7 @@ static inline void usb_ll_dis_intrs(usbh_dev_t *hw, uint32_t intr_mask) static inline void usb_ll_set_rx_fifo_size(usbh_dev_t *hw, uint32_t num_lines) { //Set size in words - hw->grxfsiz_reg.rxfdep = num_lines; + HAL_FORCE_MODIFY_U32_REG_FIELD(hw->grxfsiz_reg, rxfdep, num_lines); } // -------------------------- GNPTXFSIZ Register ------------------------------- @@ -337,8 +331,8 @@ static inline void usb_ll_set_nptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint { usb_gnptxfsiz_reg_t gnptxfsiz; gnptxfsiz.val = hw->gnptxfsiz_reg.val; - gnptxfsiz.nptxfstaddr = addr; - gnptxfsiz.nptxfdep = num_lines; + HAL_FORCE_MODIFY_U32_REG_FIELD(gnptxfsiz, nptxfstaddr, addr); + HAL_FORCE_MODIFY_U32_REG_FIELD(gnptxfsiz, nptxfdep, num_lines); hw->gnptxfsiz_reg.val = gnptxfsiz.val; } @@ -373,8 +367,8 @@ static inline void usbh_ll_set_ptx_fifo_size(usbh_dev_t *hw, uint32_t addr, uint { usb_hptxfsiz_reg_t hptxfsiz; hptxfsiz.val = hw->hptxfsiz_reg.val; - hptxfsiz.ptxfstaddr = addr; - hptxfsiz.ptxfsize = num_lines; + HAL_FORCE_MODIFY_U32_REG_FIELD(hptxfsiz, ptxfstaddr, addr); + HAL_FORCE_MODIFY_U32_REG_FIELD(hptxfsiz, ptxfsize, num_lines); hw->hptxfsiz_reg.val = hptxfsiz.val; } @@ -473,7 +467,7 @@ static inline void usbh_ll_hfir_set_defaults(usbh_dev_t *hw, usb_priv_speed_t sp static inline uint32_t usbh_ll_get_frm_time_rem(usbh_dev_t *hw) { - return hw->hfnum_reg.frrem; + return HAL_FORCE_READ_U32_REG_FIELD(hw->hfnum_reg, frrem); } static inline uint32_t usbh_ll_get_frm_num(usbh_dev_t *hw) @@ -485,7 +479,7 @@ static inline uint32_t usbh_ll_get_frm_num(usbh_dev_t *hw) static inline uint32_t usbh_ll_get_p_tx_queue_top(usbh_dev_t *hw) { - return hw->hptxsts_reg.ptxqtop; + return HAL_FORCE_READ_U32_REG_FIELD(hw->hptxsts_reg, ptxqtop); } static inline uint32_t usbh_ll_get_p_tx_queue_space_avail(usbh_dev_t *hw) @@ -495,20 +489,21 @@ static inline uint32_t usbh_ll_get_p_tx_queue_space_avail(usbh_dev_t *hw) static inline uint32_t usbh_ll_get_p_tx_fifo_space_avail(usbh_dev_t *hw) { - return hw->hptxsts_reg.ptxfspcavail; + return HAL_FORCE_READ_U32_REG_FIELD(hw->hptxsts_reg, ptxfspcavail); } // ----------------------------- HAINT Register -------------------------------- static inline uint32_t usbh_ll_get_chan_intrs_msk(usbh_dev_t *hw) { - return hw->haint_reg.haint; + return HAL_FORCE_READ_U32_REG_FIELD(hw->haint_reg, haint); } // --------------------------- HAINTMSK Register ------------------------------- static inline void usbh_ll_haintmsk_en_chan_intr(usbh_dev_t *hw, uint32_t mask) { + hw->haintmsk_reg.val |= mask; } @@ -817,31 +812,6 @@ static inline void usbh_ll_chan_set_dma_addr_non_iso(volatile usb_host_chan_regs chan->hcdma_reg.non_iso.ctd = qtd_idx; } -static inline void usbh_ll_chan_set_dma_addr_iso(volatile usb_host_chan_regs_t *chan, - void *dmaaddr, - uint32_t ntd) -{ - int n; - if (ntd == 2) { - n = 4; - } else if (ntd == 4) { - n = 5; - } else if (ntd == 8) { - n = 6; - } else if (ntd == 16) { - n = 7; - } else if (ntd == 32) { - n = 8; - } else { //ntd == 64 - n = 9; - } - //Set HCTSIZi - chan->hctsiz_reg.ntd = ntd -1; - chan->hctsiz_reg.sched_info = 0xFF; //Always set to 0xFF for FS - //Set HCDMAi - chan->hcdma_reg.iso.dmaaddr_ctd = (((uint32_t)dmaaddr) & 0x1FF) << (n-3); //ctd is set to 0 -} - static inline int usbh_ll_chan_get_ctd(usb_host_chan_regs_t *chan) { return chan->hcdma_reg.non_iso.ctd; @@ -850,12 +820,12 @@ static inline int usbh_ll_chan_get_ctd(usb_host_chan_regs_t *chan) static inline void usbh_ll_chan_hctsiz_init(volatile usb_host_chan_regs_t *chan) { chan->hctsiz_reg.dopng = 0; //Don't do ping - chan->hctsiz_reg.sched_info = 0xFF; //Schedinfo is always 0xFF for fullspeed. Not used in Bulk/Ctrl channels + HAL_FORCE_MODIFY_U32_REG_FIELD(chan->hctsiz_reg, sched_info, 0xFF); //Schedinfo is always 0xFF for fullspeed. Not used in Bulk/Ctrl channels } static inline void usbh_ll_chan_set_qtd_list_len(volatile usb_host_chan_regs_t *chan, int qtd_list_len) { - chan->hctsiz_reg.ntd = qtd_list_len - 1; //Set the length of the descriptor list + HAL_FORCE_MODIFY_U32_REG_FIELD(chan->hctsiz_reg, ntd, qtd_list_len - 1); //Set the length of the descriptor list } // ---------------------------- HCDMABi Register ------------------------------- diff --git a/tools/sdk/esp32s2/include/idf_test/include/esp32s2/idf_performance_target.h b/tools/sdk/esp32s2/include/idf_test/include/esp32s2/idf_performance_target.h index f37c2a9e00f..dc8a060f54b 100644 --- a/tools/sdk/esp32s2/include/idf_test/include/esp32s2/idf_performance_target.h +++ b/tools/sdk/esp32s2/include/idf_test/include/esp32s2/idf_performance_target.h @@ -1,16 +1,8 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/idf_test/include/esp32s3/idf_performance_target.h b/tools/sdk/esp32s2/include/idf_test/include/esp32s3/idf_performance_target.h index 62f996fc658..b744cda8fa0 100644 --- a/tools/sdk/esp32s2/include/idf_test/include/esp32s3/idf_performance_target.h +++ b/tools/sdk/esp32s2/include/idf_test/include/esp32s3/idf_performance_target.h @@ -1,23 +1,15 @@ -// Copyright 2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #define IDF_PERFORMANCE_MIN_AES_CBC_THROUGHPUT_MBSEC 43 // SHA256 hardware throughput at 240MHz, threshold set lower than worst case -#define IDF_PERFORMANCE_MIN_SHA256_THROUGHPUT_MBSEC 19.8 +#define IDF_PERFORMANCE_MIN_SHA256_THROUGHPUT_MBSEC 90 // esp_sha() time to process 32KB of input data from RAM #define IDF_PERFORMANCE_MAX_TIME_SHA1_32KB 1000 #define IDF_PERFORMANCE_MAX_TIME_SHA512_32KB 900 diff --git a/tools/sdk/esp32s2/include/idf_test/include/idf_performance.h b/tools/sdk/esp32s2/include/idf_test/include/idf_performance.h index 9d99070b953..b558feb4ca3 100644 --- a/tools/sdk/esp32s2/include/idf_test/include/idf_performance.h +++ b/tools/sdk/esp32s2/include/idf_test/include/idf_performance.h @@ -8,7 +8,7 @@ */ #ifndef IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP -#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 200 +#define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP 250 #endif #ifndef IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM #define IDF_PERFORMANCE_MAX_FREERTOS_SPINLOCK_CYCLES_PER_OP_PSRAM 300 diff --git a/tools/sdk/esp32s2/include/lwip/port/esp32/include/lwipopts.h b/tools/sdk/esp32s2/include/lwip/port/esp32/include/lwipopts.h index b9cfe17aca9..47215e99dae 100644 --- a/tools/sdk/esp32s2/include/lwip/port/esp32/include/lwipopts.h +++ b/tools/sdk/esp32s2/include/lwip/port/esp32/include/lwipopts.h @@ -1,34 +1,11 @@ /* - * Copyright (c) 2001-2003 Swedish Institute of Computer Science. - * All rights reserved. + * SPDX-FileCopyrightText: 2001-2003 Swedish Institute of Computer Science * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Simon Goldschmidt + * SPDX-License-Identifier: BSD-3-Clause * + * SPDX-FileContributor: 2015-2021 Espressif Systems (Shanghai) CO LTD */ + #ifndef __LWIPOPTS_H__ #define __LWIPOPTS_H__ @@ -272,6 +249,11 @@ */ #define DHCP_OPTIONS_LEN CONFIG_LWIP_DHCP_OPTIONS_LEN +/** + * LWIP_DHCP_DISABLE_VENDOR_CLASS_ID==1: Do not add option 60 (Vendor Class Identifier) to DHCP packets + */ +#define ESP_DHCP_DISABLE_VENDOR_CLASS_IDENTIFIER CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID + /* ------------------------------------ ---------- AUTOIP options ---------- diff --git a/tools/sdk/esp32s2/include/mbedtls/port/include/mbedtls/bignum.h b/tools/sdk/esp32s2/include/mbedtls/port/include/mbedtls/bignum.h index a317c456060..4f84bed7407 100644 --- a/tools/sdk/esp32s2/include/mbedtls/port/include/mbedtls/bignum.h +++ b/tools/sdk/esp32s2/include/mbedtls/port/include/mbedtls/bignum.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once #include_next "mbedtls/bignum.h" @@ -77,4 +69,31 @@ void esp_mpi_release_hardware(void); */ int esp_mpi_mul_mpi_mod(mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M); +#if CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI + +/** + * @brief Perform a sliding-window exponentiation: X = A^E mod N + * + * @param X The destination MPI. This must point to an initialized MPI. + * @param A The base of the exponentiation. + * This must point to an initialized MPI. + * @param E The exponent MPI. This must point to an initialized MPI. + * @param N The base for the modular reduction. This must point to an + * initialized MPI. + * @param _RR A helper MPI depending solely on \p N which can be used to + * speed-up multiple modular exponentiations for the same value + * of \p N. This may be \c NULL. If it is not \c NULL, it must + * point to an initialized MPI. + * + * @return \c 0 if successful. + * @return #MBEDTLS_ERR_MPI_ALLOC_FAILED if a memory allocation failed. + * @return #MBEDTLS_ERR_MPI_BAD_INPUT_DATA if \c N is negative or + * even, or if \c E is negative. + * @return Another negative error code on different kinds of failures. + * + */ +int mbedtls_mpi_exp_mod_soft(mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi *E, const mbedtls_mpi *N, mbedtls_mpi *_RR); + +#endif // CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI + #endif // CONFIG_MBEDTLS_HARDWARE_MPI diff --git a/tools/sdk/esp32s2/include/mbedtls/port/include/mbedtls/esp_config.h b/tools/sdk/esp32s2/include/mbedtls/port/include/mbedtls/esp_config.h index f36ebf9bc75..9c63118eb57 100644 --- a/tools/sdk/esp32s2/include/mbedtls/port/include/mbedtls/esp_config.h +++ b/tools/sdk/esp32s2/include/mbedtls/port/include/mbedtls/esp_config.h @@ -153,15 +153,22 @@ #undef MBEDTLS_MD5_ALT #endif -/* The following MPI (bignum) functions have ESP32 hardware support. - For exponential mod, both software and hardware implementation - will be compiled. If CONFIG_MBEDTLS_HARDWARE_MPI is enabled, mod APIs - will be wrapped to use hardware implementation. -*/ -#undef MBEDTLS_MPI_EXP_MOD_ALT +/* The following MPI (bignum) functions have hardware support. + * Uncommenting these macros will use the hardware-accelerated + * implementations. + */ #ifdef CONFIG_MBEDTLS_HARDWARE_MPI +#ifdef CONFIG_MBEDTLS_LARGE_KEY_SOFTWARE_MPI + /* Prefer hardware and fallback to software */ + #define MBEDTLS_MPI_EXP_MOD_ALT_FALLBACK +#else + /* Hardware only mode */ + #define MBEDTLS_MPI_EXP_MOD_ALT +#endif #define MBEDTLS_MPI_MUL_MPI_ALT #else +#undef MBEDTLS_MPI_EXP_MOD_ALT_FALLBACK +#undef MBEDTLS_MPI_EXP_MOD_ALT #undef MBEDTLS_MPI_MUL_MPI_ALT #endif diff --git a/tools/sdk/esp32s2/include/sdmmc/include/sdmmc_cmd.h b/tools/sdk/esp32s2/include/sdmmc/include/sdmmc_cmd.h index 6e2f98d90d6..e0e7162391b 100644 --- a/tools/sdk/esp32s2/include/sdmmc/include/sdmmc_cmd.h +++ b/tools/sdk/esp32s2/include/sdmmc/include/sdmmc_cmd.h @@ -1,16 +1,8 @@ -// Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once @@ -45,6 +37,17 @@ esp_err_t sdmmc_card_init(const sdmmc_host_t* host, */ void sdmmc_card_print_info(FILE* stream, const sdmmc_card_t* card); +/** + * Get status of SD/MMC card + * + * @param card pointer to card information structure previously initialized + * using sdmmc_card_init + * @return + * - ESP_OK on success + * - One of the error codes from SDMMC host controller + */ +esp_err_t sdmmc_get_status(sdmmc_card_t* card); + /** * Write given number of sectors to SD/MMC card * diff --git a/tools/sdk/esp32s2/include/usb/include/usb/usb_host.h b/tools/sdk/esp32s2/include/usb/include/usb/usb_host.h index 6c104af6cfd..9a91e7ed18f 100644 --- a/tools/sdk/esp32s2/include/usb/include/usb/usb_host.h +++ b/tools/sdk/esp32s2/include/usb/include/usb/usb_host.h @@ -27,7 +27,14 @@ extern "C" { // ----------------------- Handles ------------------------- -typedef void * usb_host_client_handle_t; /**< Handle to a client using the USB Host Library */ +/** + * @brief Handle to a USB Host Library asynchronous client + * + * An asynchronous client can be registered using usb_host_client_register() + * + * @note Asynchronous API + */ +typedef struct usb_host_client_handle_s * usb_host_client_handle_t; // ----------------------- Events -------------------------- @@ -93,9 +100,14 @@ typedef struct { * Configuration structure for a USB Host Library client. Provided in usb_host_client_register() */ typedef struct { - usb_host_client_event_cb_t client_event_callback; /**< Client's event callback function */ - void *callback_arg; /**< Event callback function argument */ - int max_num_event_msg; /**< Maximum number of event messages that can be stored (e.g., 3) */ + bool is_synchronous; /**< Whether the client is asynchronous or synchronous or not. Set to false for now. */ + int max_num_event_msg; /**< Maximum number of event messages that can be stored (e.g., 3) */ + union { //Note: Made into union or future expansion + struct { + usb_host_client_event_cb_t client_event_callback; /**< Client's event callback function */ + void *callback_arg; /**< Event callback function argument */ + } async; + }; } usb_host_client_config_t; // ------------------------------------------------ Library Functions -------------------------------------------------- @@ -129,12 +141,22 @@ esp_err_t usb_host_uninstall(void); * - This function handles all of the USB Host Library's processing and should be called repeatedly in a loop * - Check event_flags_ret to see if an flags are set indicating particular USB Host Library events * + * @note This function can block * @param[in] timeout_ticks Timeout in ticks to wait for an event to occur * @param[out] event_flags_ret Event flags that indicate what USB Host Library event occurred * @return esp_err_t */ esp_err_t usb_host_lib_handle_events(TickType_t timeout_ticks, uint32_t *event_flags_ret); +/** + * @brief Unblock the USB Host Library handler + * + * - This function simply unblocks the USB Host Library event handling function (usb_host_lib_handle_events()) + * + * @return esp_err_t + */ +esp_err_t usb_host_lib_unblock(void); + // ------------------------------------------------ Client Functions --------------------------------------------------- /** @@ -165,6 +187,7 @@ esp_err_t usb_host_client_deregister(usb_host_client_handle_t client_hdl); * * - This function handles all of a client's processing and should be called repeatedly in a loop * + * @note This function can block * @param[in] client_hdl Client handle * @param[in] timeout_ticks Timeout in ticks to wait for an event to occur * @return esp_err_t @@ -204,6 +227,7 @@ esp_err_t usb_host_device_open(usb_host_client_handle_t client_hdl, uint8_t dev_ * - A client must close a device after it has finished using the device (claimed interfaces must also be released) * - A client must close all devices it has opened before deregistering * + * @note This function can block * @param[in] client_hdl Client handle * @param[in] dev_hdl Device handle * @return esp_err_t @@ -220,10 +244,28 @@ esp_err_t usb_host_device_close(usb_host_client_handle_t client_hdl, usb_device_ * when all devices have been freed * - This function is useful when cleaning up devices before uninstalling the USB Host Library * - * @return esp_err_t + * @return + * - ESP_ERR_NOT_FINISHED: There are one or more devices that still need to be freed. Wait for USB_HOST_LIB_EVENT_FLAGS_ALL_FREE event + * - ESP_OK: All devices already freed (i.e., there were no devices) + * - Other: Error */ esp_err_t usb_host_device_free_all(void); +/** + * @brief Fill a list of device address + * + * - This function fills an empty list with the address of connected devices + * - The Device addresses can then used in usb_host_device_open() + * - If there are more devices than the list_len, this function will only fill + * up to list_len number of devices. + * + * @param[in] list_len Length of the empty list + * @param[inout] dev_addr_list Empty list to be filled + * @param[out] num_dev_ret Number of devices + * @return esp_err_t + */ +esp_err_t usb_host_device_addr_list_fill(int list_len, uint8_t *dev_addr_list, int *num_dev_ret); + // ------------------------------------------------- Device Requests --------------------------------------------------- // ------------------- Cached Requests --------------------- @@ -234,6 +276,7 @@ esp_err_t usb_host_device_free_all(void); * - This function gets some basic information of a device * - The device must be opened first before attempting to get its information * + * @note This function can block * @param[in] dev_hdl Device handle * @param[out] dev_info Device information * @return esp_err_t @@ -265,6 +308,7 @@ esp_err_t usb_host_get_device_descriptor(usb_device_handle_t dev_hdl, const usb_ * - No control transfer is sent. The device's active configuration descriptor is cached on enumeration * - This function simple returns a pointer to the cached descriptor * + * @note This function can block * @note No control transfer is sent. A device's active configuration descriptor is cached on enumeration * @param[in] dev_hdl Device handle * @param[out] config_desc Configuration descriptor @@ -280,6 +324,7 @@ esp_err_t usb_host_get_active_config_descriptor(usb_device_handle_t dev_hdl, con * - A client must claim a device's interface before attempting to communicate with any of its endpoints * - Once an interface is claimed by a client, it cannot be claimed by any other client. * + * @note This function can block * @param[in] client_hdl Client handle * @param[in] dev_hdl Device handle * @param[in] bInterfaceNumber Interface number @@ -294,6 +339,7 @@ esp_err_t usb_host_interface_claim(usb_host_client_handle_t client_hdl, usb_devi * - A client should release a device's interface after it no longer needs to communicate with the interface * - A client must release all of its interfaces of a device it has claimed before being able to close the device * + * @note This function can block * @param[in] client_hdl Client handle * @param[in] dev_hdl Device handle * @param[in] bInterfaceNumber Interface number @@ -308,6 +354,7 @@ esp_err_t usb_host_interface_release(usb_host_client_handle_t client_hdl, usb_de * - The endpoint must be part of an interface claimed by a client * - Once halted, the endpoint must be cleared using usb_host_endpoint_clear() before it can communicate again * + * @note This function can block * @param dev_hdl Device handle * @param bEndpointAddress Endpoint address * @return esp_err_t @@ -322,6 +369,7 @@ esp_err_t usb_host_endpoint_halt(usb_device_handle_t dev_hdl, uint8_t bEndpointA * - The endpoint must have been halted (either through a transfer error, or usb_host_endpoint_halt()) * - Flushing an endpoint will caused an queued up transfers to be canceled * + * @note This function can block * @param dev_hdl Device handle * @param bEndpointAddress Endpoint address * @return esp_err_t @@ -336,6 +384,7 @@ esp_err_t usb_host_endpoint_flush(usb_device_handle_t dev_hdl, uint8_t bEndpoint * - The endpoint must have been halted (either through a transfer error, or usb_host_endpoint_halt()) * - If the endpoint has any queued up transfers, clearing a halt will resume their execution * + * @note This function can block * @param dev_hdl Device handle * @param bEndpointAddress Endpoint address * @return esp_err_t @@ -396,17 +445,6 @@ esp_err_t usb_host_transfer_submit(usb_transfer_t *transfer); */ esp_err_t usb_host_transfer_submit_control(usb_host_client_handle_t client_hdl, usb_transfer_t *transfer); -/** - * @brief Cancel a submitted transfer - * - * - Cancel a previously submitted transfer - * - In its current implementation, any transfer that is already in-flight will not be canceled - * - * @param transfer Transfer object - * @return esp_err_t - */ -esp_err_t usb_host_transfer_cancel(usb_transfer_t *transfer); - #ifdef __cplusplus } #endif diff --git a/tools/sdk/esp32s2/include/usb/include/usb/usb_types_stack.h b/tools/sdk/esp32s2/include/usb/include/usb/usb_types_stack.h index 438c22d9ef3..974d01def55 100644 --- a/tools/sdk/esp32s2/include/usb/include/usb/usb_types_stack.h +++ b/tools/sdk/esp32s2/include/usb/include/usb/usb_types_stack.h @@ -43,7 +43,7 @@ typedef enum { /** * @brief Handle of a USB Device connected to a USB Host */ -typedef void * usb_device_handle_t; +typedef struct usb_device_handle_s * usb_device_handle_t; /** * @brief Basic information of an enumerated device @@ -68,6 +68,7 @@ typedef enum { USB_TRANSFER_STATUS_STALL, /**< The transfer was stalled */ USB_TRANSFER_STATUS_OVERFLOW, /**< The transfer as more data was sent than was requested */ USB_TRANSFER_STATUS_SKIPPED, /**< ISOC packets only. The packet was skipped due to system latency or bus overload */ + USB_TRANSFER_STATUS_NO_DEVICE, /**< The transfer failed because the target device is gone */ } usb_transfer_status_t; /** @@ -102,7 +103,10 @@ typedef struct { * split into multiple packets, and each packet is transferred at the endpoint's specified interval. * - Isochronous: Represents a stream of bytes that should be transferred to an endpoint at a fixed rate. The transfer * is split into packets according to the each isoc_packet_desc. A packet is transferred at each interval - * of the endpoint. + * of the endpoint. If an entire ISOC URB was transferred without error (skipped packets do not count as + * errors), the URB's overall status and the status of each packet descriptor will be updated, and the + * actual_num_bytes reflects the total bytes transferred over all packets. If the ISOC URB encounters an + * error, the entire URB is considered erroneous so only the overall status will updated. * * @note For Bulk/Control/Interrupt IN transfers, the num_bytes must be a integer multiple of the endpoint's MPS * @note This structure should be allocated via usb_host_transfer_alloc() diff --git a/tools/sdk/esp32s2/include/vfs/include/esp_vfs.h b/tools/sdk/esp32s2/include/vfs/include/esp_vfs.h index 7ba63645301..0498a3aa59b 100644 --- a/tools/sdk/esp32s2/include/vfs/include/esp_vfs.h +++ b/tools/sdk/esp32s2/include/vfs/include/esp_vfs.h @@ -1,16 +1,8 @@ -// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #ifndef __ESP_VFS_H__ #define __ESP_VFS_H__ @@ -254,7 +246,6 @@ typedef struct #endif // CONFIG_VFS_SUPPORT_SELECT } esp_vfs_t; - /** * Register a virtual filesystem for given path prefix. * @@ -411,7 +402,8 @@ int esp_vfs_utime(const char *path, const struct utimbuf *times); * @param timeout If not NULL, then points to timeval structure which * specifies the time period after which the functions should * time-out and return. If it is NULL, then the function will - * not time-out. + * not time-out. Note that the timeout period is rounded up to + * the system tick and incremented by one. * * @return The number of descriptors set in the descriptor sets, or -1 * when an error (specified by errno) have occurred. diff --git a/tools/sdk/esp32s2/include/vfs/include/esp_vfs_cdcacm.h b/tools/sdk/esp32s2/include/vfs/include/esp_vfs_cdcacm.h index b8dd03d92aa..416efb35a4e 100644 --- a/tools/sdk/esp32s2/include/vfs/include/esp_vfs_cdcacm.h +++ b/tools/sdk/esp32s2/include/vfs/include/esp_vfs_cdcacm.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/vfs/include/esp_vfs_console.h b/tools/sdk/esp32s2/include/vfs/include/esp_vfs_console.h new file mode 100644 index 00000000000..bc5ce6733dd --- /dev/null +++ b/tools/sdk/esp32s2/include/vfs/include/esp_vfs_console.h @@ -0,0 +1,24 @@ +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "esp_err.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief add uart/usb_serial_jtag/usb_otg_acmcdc virtual filesystem driver + * + * This function is called from startup code to enable serial output + */ +esp_err_t esp_vfs_console_register(void); + +#ifdef __cplusplus +} +#endif diff --git a/tools/sdk/esp32s2/include/vfs/include/esp_vfs_dev.h b/tools/sdk/esp32s2/include/vfs/include/esp_vfs_dev.h index dc33fe746dc..91e9374972e 100644 --- a/tools/sdk/esp32s2/include/vfs/include/esp_vfs_dev.h +++ b/tools/sdk/esp32s2/include/vfs/include/esp_vfs_dev.h @@ -1,16 +1,8 @@ -// Copyright 2015-2017 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/include/vfs/include/esp_vfs_usb_serial_jtag.h b/tools/sdk/esp32s2/include/vfs/include/esp_vfs_usb_serial_jtag.h index 54ff1f4e444..c53a671be89 100644 --- a/tools/sdk/esp32s2/include/vfs/include/esp_vfs_usb_serial_jtag.h +++ b/tools/sdk/esp32s2/include/vfs/include/esp_vfs_usb_serial_jtag.h @@ -1,16 +1,8 @@ -// Copyright 2021 Espressif Systems (Shanghai) PTE LTD -// -// 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. +/* + * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ #pragma once diff --git a/tools/sdk/esp32s2/ld/libcat_face_detect.a b/tools/sdk/esp32s2/ld/libcat_face_detect.a index 0be62683524..3e06b1dab00 100644 Binary files a/tools/sdk/esp32s2/ld/libcat_face_detect.a and b/tools/sdk/esp32s2/ld/libcat_face_detect.a differ diff --git a/tools/sdk/esp32s2/ld/libcolor_detect.a b/tools/sdk/esp32s2/ld/libcolor_detect.a index 9de44aa6021..59c73d0f498 100644 Binary files a/tools/sdk/esp32s2/ld/libcolor_detect.a and b/tools/sdk/esp32s2/ld/libcolor_detect.a differ diff --git a/tools/sdk/esp32s2/ld/libdl.a b/tools/sdk/esp32s2/ld/libdl.a index 64762c5e64d..69214ae6c66 100644 Binary files a/tools/sdk/esp32s2/ld/libdl.a and b/tools/sdk/esp32s2/ld/libdl.a differ diff --git a/tools/sdk/esp32s2/ld/libhuman_face_detect.a b/tools/sdk/esp32s2/ld/libhuman_face_detect.a index 871f0bbc997..d7e1d7a0e19 100644 Binary files a/tools/sdk/esp32s2/ld/libhuman_face_detect.a and b/tools/sdk/esp32s2/ld/libhuman_face_detect.a differ diff --git a/tools/sdk/esp32s2/ld/libmfn.a b/tools/sdk/esp32s2/ld/libmfn.a index 9d26756b63e..fda053f4ace 100644 Binary files a/tools/sdk/esp32s2/ld/libmfn.a and b/tools/sdk/esp32s2/ld/libmfn.a differ diff --git a/tools/sdk/esp32s2/ld/sections.ld b/tools/sdk/esp32s2/ld/sections.ld index 8ed2c2243c2..278d84c981a 100644 --- a/tools/sdk/esp32s2/ld/sections.ld +++ b/tools/sdk/esp32s2/ld/sections.ld @@ -1,6 +1,6 @@ /* Automatically generated file; DO NOT EDIT */ /* Espressif IoT Development Framework Linker Script */ -/* Generated from: /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/ld/esp32s2/sections.ld.in */ +/* Generated from: /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/esp_system/ld/esp32s2/sections.ld.in */ /* * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD @@ -204,8 +204,8 @@ SECTIONS *libesp_system.a:esp_system.*(.literal.esp_system_abort .text.esp_system_abort) *libesp_system.a:ubsan.*(.literal .literal.* .text .text.*) *libfreertos.a:(EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .literal EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .literal.* EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .text EXCLUDE_FILE(*libfreertos.a:port.* *libfreertos.a:port_common.*) .text.*) - *libfreertos.a:port.*(.literal.pxPortInitialiseStack .literal.unlikely.vPortEndScheduler .literal.vApplicationStackOverflowHook .literal.vPortAssertIfInISR .literal.vPortEnterCritical .literal.vPortExitCritical .literal.vPortSetStackWatchpoint .literal.vPortYieldOtherCore .literal.xPortInIsrContext .literal.xPortStartScheduler .text .text.pxPortInitialiseStack .text.unlikely.vPortEndScheduler .text.vApplicationStackOverflowHook .text.vPortAssertIfInISR .text.vPortEnterCritical .text.vPortExitCritical .text.vPortSetStackWatchpoint .text.vPortYieldOtherCore .text.xPortGetTickRateHz .text.xPortInIsrContext .text.xPortStartScheduler) - *libfreertos.a:port_common.*(.literal.esp_startup_start_app_common .literal.xPortCheckValidTCBMem .literal.xPortcheckValidStackMem .text .text.esp_startup_start_app_common .text.xPortCheckValidTCBMem .text.xPortcheckValidStackMem) + *libfreertos.a:port.*(.literal.pxPortInitialiseStack .literal.unlikely.vPortEndScheduler .literal.vApplicationStackOverflowHook .literal.vPortAssertIfInISR .literal.vPortExitCritical .literal.vPortExitCritical$constprop$1 .literal.vPortExitCriticalCompliance .literal.vPortSetStackWatchpoint .literal.vPortYieldOtherCore .literal.xPortEnterCriticalTimeout .literal.xPortEnterCriticalTimeout$constprop$2 .literal.xPortEnterCriticalTimeoutCompliance .literal.xPortInIsrContext .literal.xPortStartScheduler .text .text.pxPortInitialiseStack .text.unlikely.vPortEndScheduler .text.vApplicationStackOverflowHook .text.vPortAssertIfInISR .text.vPortExitCritical .text.vPortExitCritical$constprop$1 .text.vPortExitCriticalCompliance .text.vPortSetStackWatchpoint .text.vPortYieldOtherCore .text.xPortEnterCriticalTimeout .text.xPortEnterCriticalTimeout$constprop$2 .text.xPortEnterCriticalTimeoutCompliance .text.xPortGetTickRateHz .text.xPortInIsrContext .text.xPortStartScheduler) + *libfreertos.a:port_common.*(.literal.esp_startup_start_app_common .literal.vApplicationGetIdleTaskMemory .literal.vApplicationGetTimerTaskMemory .literal.xPortCheckValidTCBMem .literal.xPortcheckValidStackMem .text .text.esp_startup_start_app_common .text.vApplicationGetIdleTaskMemory .text.vApplicationGetTimerTaskMemory .text.xPortCheckValidTCBMem .text.xPortcheckValidStackMem) *libgcc.a:_divsf3.*(.literal .literal.* .text .text.*) *libgcc.a:lib2funcs.*(.literal .literal.* .text .text.*) *libgcov.a:(.literal .literal.* .text .text.*) diff --git a/tools/sdk/esp32s2/lib/libapp_trace.a b/tools/sdk/esp32s2/lib/libapp_trace.a index 5fcd6537fad..9f3ef64051d 100644 Binary files a/tools/sdk/esp32s2/lib/libapp_trace.a and b/tools/sdk/esp32s2/lib/libapp_trace.a differ diff --git a/tools/sdk/esp32s2/lib/libapp_update.a b/tools/sdk/esp32s2/lib/libapp_update.a index ad928b0560a..4df1eb88005 100644 Binary files a/tools/sdk/esp32s2/lib/libapp_update.a and b/tools/sdk/esp32s2/lib/libapp_update.a differ diff --git a/tools/sdk/esp32s2/lib/libarduino_tinyusb.a b/tools/sdk/esp32s2/lib/libarduino_tinyusb.a index 052ee1d455f..88ca4f39605 100644 Binary files a/tools/sdk/esp32s2/lib/libarduino_tinyusb.a and b/tools/sdk/esp32s2/lib/libarduino_tinyusb.a differ diff --git a/tools/sdk/esp32s2/lib/libasio.a b/tools/sdk/esp32s2/lib/libasio.a index 6034e81fec8..a11e63f9046 100644 Binary files a/tools/sdk/esp32s2/lib/libasio.a and b/tools/sdk/esp32s2/lib/libasio.a differ diff --git a/tools/sdk/esp32s2/lib/libbootloader_support.a b/tools/sdk/esp32s2/lib/libbootloader_support.a index 54fb8c331cd..fc067928c95 100644 Binary files a/tools/sdk/esp32s2/lib/libbootloader_support.a and b/tools/sdk/esp32s2/lib/libbootloader_support.a differ diff --git a/tools/sdk/esp32s2/lib/libcbor.a b/tools/sdk/esp32s2/lib/libcbor.a index 284c55a0e4f..de741bef5fb 100644 Binary files a/tools/sdk/esp32s2/lib/libcbor.a and b/tools/sdk/esp32s2/lib/libcbor.a differ diff --git a/tools/sdk/esp32s2/lib/libcmock.a b/tools/sdk/esp32s2/lib/libcmock.a index 7c84a561dad..423e4268e69 100644 Binary files a/tools/sdk/esp32s2/lib/libcmock.a and b/tools/sdk/esp32s2/lib/libcmock.a differ diff --git a/tools/sdk/esp32s2/lib/libcoap.a b/tools/sdk/esp32s2/lib/libcoap.a index f946a10537a..d68fb20bea6 100644 Binary files a/tools/sdk/esp32s2/lib/libcoap.a and b/tools/sdk/esp32s2/lib/libcoap.a differ diff --git a/tools/sdk/esp32s2/lib/libcoexist.a b/tools/sdk/esp32s2/lib/libcoexist.a index 90997cb8692..20fb8051544 100644 Binary files a/tools/sdk/esp32s2/lib/libcoexist.a and b/tools/sdk/esp32s2/lib/libcoexist.a differ diff --git a/tools/sdk/esp32s2/lib/libconsole.a b/tools/sdk/esp32s2/lib/libconsole.a index ffb7e3d33d7..62fadecaf5f 100644 Binary files a/tools/sdk/esp32s2/lib/libconsole.a and b/tools/sdk/esp32s2/lib/libconsole.a differ diff --git a/tools/sdk/esp32s2/lib/libcore.a b/tools/sdk/esp32s2/lib/libcore.a index f5bc6e23940..e01c44ee438 100644 Binary files a/tools/sdk/esp32s2/lib/libcore.a and b/tools/sdk/esp32s2/lib/libcore.a differ diff --git a/tools/sdk/esp32s2/lib/libcxx.a b/tools/sdk/esp32s2/lib/libcxx.a index a08638886d2..2da8f501293 100644 Binary files a/tools/sdk/esp32s2/lib/libcxx.a and b/tools/sdk/esp32s2/lib/libcxx.a differ diff --git a/tools/sdk/esp32s2/lib/libdriver.a b/tools/sdk/esp32s2/lib/libdriver.a index 3ec8a2fdf9a..a47ffb66908 100644 Binary files a/tools/sdk/esp32s2/lib/libdriver.a and b/tools/sdk/esp32s2/lib/libdriver.a differ diff --git a/tools/sdk/esp32s2/lib/libefuse.a b/tools/sdk/esp32s2/lib/libefuse.a index a48642dd514..c94fb0a07be 100644 Binary files a/tools/sdk/esp32s2/lib/libefuse.a and b/tools/sdk/esp32s2/lib/libefuse.a differ diff --git a/tools/sdk/esp32s2/lib/libesp-dsp.a b/tools/sdk/esp32s2/lib/libesp-dsp.a index eec4a5acec7..ce26e4da42c 100644 Binary files a/tools/sdk/esp32s2/lib/libesp-dsp.a and b/tools/sdk/esp32s2/lib/libesp-dsp.a differ diff --git a/tools/sdk/esp32s2/lib/libesp-tls.a b/tools/sdk/esp32s2/lib/libesp-tls.a index 4e3c381e1e2..4fd759d9104 100644 Binary files a/tools/sdk/esp32s2/lib/libesp-tls.a and b/tools/sdk/esp32s2/lib/libesp-tls.a differ diff --git a/tools/sdk/esp32s2/lib/libesp32-camera.a b/tools/sdk/esp32s2/lib/libesp32-camera.a index 25d1757ddf9..b1d03db9ff4 100644 Binary files a/tools/sdk/esp32s2/lib/libesp32-camera.a and b/tools/sdk/esp32s2/lib/libesp32-camera.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_adc_cal.a b/tools/sdk/esp32s2/lib/libesp_adc_cal.a index c6ea5d8ebf6..e467f74cdc0 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_adc_cal.a and b/tools/sdk/esp32s2/lib/libesp_adc_cal.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_common.a b/tools/sdk/esp32s2/lib/libesp_common.a index 3514d86bd3f..d9e5437f105 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_common.a and b/tools/sdk/esp32s2/lib/libesp_common.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_eth.a b/tools/sdk/esp32s2/lib/libesp_eth.a index 529294dd7b4..e15127e4ae3 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_eth.a and b/tools/sdk/esp32s2/lib/libesp_eth.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_event.a b/tools/sdk/esp32s2/lib/libesp_event.a index 172d8ad33a8..e5645673094 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_event.a and b/tools/sdk/esp32s2/lib/libesp_event.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_gdbstub.a b/tools/sdk/esp32s2/lib/libesp_gdbstub.a index c708c1536a5..bec69001a6a 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_gdbstub.a and b/tools/sdk/esp32s2/lib/libesp_gdbstub.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_hid.a b/tools/sdk/esp32s2/lib/libesp_hid.a index 2560e9522e5..2c6dc8f2632 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_hid.a and b/tools/sdk/esp32s2/lib/libesp_hid.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_http_client.a b/tools/sdk/esp32s2/lib/libesp_http_client.a index b097a505627..014ef9db0dd 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_http_client.a and b/tools/sdk/esp32s2/lib/libesp_http_client.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_http_server.a b/tools/sdk/esp32s2/lib/libesp_http_server.a index c067adc0ffe..3e6317ecadf 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_http_server.a and b/tools/sdk/esp32s2/lib/libesp_http_server.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_https_ota.a b/tools/sdk/esp32s2/lib/libesp_https_ota.a index 43b4c64c5a8..bd3a929c581 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_https_ota.a and b/tools/sdk/esp32s2/lib/libesp_https_ota.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_https_server.a b/tools/sdk/esp32s2/lib/libesp_https_server.a index ce327107f22..28305cae1fd 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_https_server.a and b/tools/sdk/esp32s2/lib/libesp_https_server.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_hw_support.a b/tools/sdk/esp32s2/lib/libesp_hw_support.a index 49becc53a71..30edc9fad03 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_hw_support.a and b/tools/sdk/esp32s2/lib/libesp_hw_support.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_ipc.a b/tools/sdk/esp32s2/lib/libesp_ipc.a index 91cf83c6f76..9916930d2c5 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_ipc.a and b/tools/sdk/esp32s2/lib/libesp_ipc.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_lcd.a b/tools/sdk/esp32s2/lib/libesp_lcd.a index be75e898769..eee68ce4ca0 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_lcd.a and b/tools/sdk/esp32s2/lib/libesp_lcd.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_littlefs.a b/tools/sdk/esp32s2/lib/libesp_littlefs.a index 4b0de592d62..11283bbf2a3 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_littlefs.a and b/tools/sdk/esp32s2/lib/libesp_littlefs.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_local_ctrl.a b/tools/sdk/esp32s2/lib/libesp_local_ctrl.a index cd0121e1bff..5f1d6261334 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_local_ctrl.a and b/tools/sdk/esp32s2/lib/libesp_local_ctrl.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_netif.a b/tools/sdk/esp32s2/lib/libesp_netif.a index a7b68e9056f..d816609bc4a 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_netif.a and b/tools/sdk/esp32s2/lib/libesp_netif.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_phy.a b/tools/sdk/esp32s2/lib/libesp_phy.a index a894582a32a..de8096ef24c 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_phy.a and b/tools/sdk/esp32s2/lib/libesp_phy.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_pm.a b/tools/sdk/esp32s2/lib/libesp_pm.a index 85f84893c6c..dbf4c3866c6 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_pm.a and b/tools/sdk/esp32s2/lib/libesp_pm.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_ringbuf.a b/tools/sdk/esp32s2/lib/libesp_ringbuf.a index d8ad7ed82ac..85c8db36c07 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_ringbuf.a and b/tools/sdk/esp32s2/lib/libesp_ringbuf.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_rom.a b/tools/sdk/esp32s2/lib/libesp_rom.a index 1f290b10d46..cc398e1b612 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_rom.a and b/tools/sdk/esp32s2/lib/libesp_rom.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a b/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a index dfd06c5d668..168efadc926 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a and b/tools/sdk/esp32s2/lib/libesp_serial_slave_link.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_system.a b/tools/sdk/esp32s2/lib/libesp_system.a index a9aac0ac990..e7f2ec0ebfc 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_system.a and b/tools/sdk/esp32s2/lib/libesp_system.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_timer.a b/tools/sdk/esp32s2/lib/libesp_timer.a index 20d2460a145..abf4d46141a 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_timer.a and b/tools/sdk/esp32s2/lib/libesp_timer.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_websocket_client.a b/tools/sdk/esp32s2/lib/libesp_websocket_client.a index 5d41960269a..16946a606f4 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_websocket_client.a and b/tools/sdk/esp32s2/lib/libesp_websocket_client.a differ diff --git a/tools/sdk/esp32s2/lib/libesp_wifi.a b/tools/sdk/esp32s2/lib/libesp_wifi.a index 15aa13c122f..a728e0dd76d 100644 Binary files a/tools/sdk/esp32s2/lib/libesp_wifi.a and b/tools/sdk/esp32s2/lib/libesp_wifi.a differ diff --git a/tools/sdk/esp32s2/lib/libespcoredump.a b/tools/sdk/esp32s2/lib/libespcoredump.a index f04ae2ffdda..06091cc0866 100644 Binary files a/tools/sdk/esp32s2/lib/libespcoredump.a and b/tools/sdk/esp32s2/lib/libespcoredump.a differ diff --git a/tools/sdk/esp32s2/lib/libespnow.a b/tools/sdk/esp32s2/lib/libespnow.a index 3058c2a659d..6c6fae7f52e 100644 Binary files a/tools/sdk/esp32s2/lib/libespnow.a and b/tools/sdk/esp32s2/lib/libespnow.a differ diff --git a/tools/sdk/esp32s2/lib/libexpat.a b/tools/sdk/esp32s2/lib/libexpat.a index aaf613863db..fd2a43f0538 100644 Binary files a/tools/sdk/esp32s2/lib/libexpat.a and b/tools/sdk/esp32s2/lib/libexpat.a differ diff --git a/tools/sdk/esp32s2/lib/libfatfs.a b/tools/sdk/esp32s2/lib/libfatfs.a index ac59744d6d1..f3643750b41 100644 Binary files a/tools/sdk/esp32s2/lib/libfatfs.a and b/tools/sdk/esp32s2/lib/libfatfs.a differ diff --git a/tools/sdk/esp32s2/lib/libfb_gfx.a b/tools/sdk/esp32s2/lib/libfb_gfx.a index f816b308a70..adc3953e3fd 100644 Binary files a/tools/sdk/esp32s2/lib/libfb_gfx.a and b/tools/sdk/esp32s2/lib/libfb_gfx.a differ diff --git a/tools/sdk/esp32s2/lib/libfreemodbus.a b/tools/sdk/esp32s2/lib/libfreemodbus.a index 77c973ddd43..38f5c16b5bb 100644 Binary files a/tools/sdk/esp32s2/lib/libfreemodbus.a and b/tools/sdk/esp32s2/lib/libfreemodbus.a differ diff --git a/tools/sdk/esp32s2/lib/libfreertos.a b/tools/sdk/esp32s2/lib/libfreertos.a index c95ff4f51fc..447b5b00404 100644 Binary files a/tools/sdk/esp32s2/lib/libfreertos.a and b/tools/sdk/esp32s2/lib/libfreertos.a differ diff --git a/tools/sdk/esp32s2/lib/libhal.a b/tools/sdk/esp32s2/lib/libhal.a index 4b12f9555be..bbad43eec36 100644 Binary files a/tools/sdk/esp32s2/lib/libhal.a and b/tools/sdk/esp32s2/lib/libhal.a differ diff --git a/tools/sdk/esp32s2/lib/libheap.a b/tools/sdk/esp32s2/lib/libheap.a index 5433c988351..a984f1ca996 100644 Binary files a/tools/sdk/esp32s2/lib/libheap.a and b/tools/sdk/esp32s2/lib/libheap.a differ diff --git a/tools/sdk/esp32s2/lib/libjsmn.a b/tools/sdk/esp32s2/lib/libjsmn.a index 39fd30d2d8a..df05c34b6f1 100644 Binary files a/tools/sdk/esp32s2/lib/libjsmn.a and b/tools/sdk/esp32s2/lib/libjsmn.a differ diff --git a/tools/sdk/esp32s2/lib/libjson.a b/tools/sdk/esp32s2/lib/libjson.a index f9348971752..1a30841af61 100644 Binary files a/tools/sdk/esp32s2/lib/libjson.a and b/tools/sdk/esp32s2/lib/libjson.a differ diff --git a/tools/sdk/esp32s2/lib/liblibsodium.a b/tools/sdk/esp32s2/lib/liblibsodium.a index b5125365c8c..f9b63259236 100644 Binary files a/tools/sdk/esp32s2/lib/liblibsodium.a and b/tools/sdk/esp32s2/lib/liblibsodium.a differ diff --git a/tools/sdk/esp32s2/lib/liblog.a b/tools/sdk/esp32s2/lib/liblog.a index f03841680ca..ae9729a9d0e 100644 Binary files a/tools/sdk/esp32s2/lib/liblog.a and b/tools/sdk/esp32s2/lib/liblog.a differ diff --git a/tools/sdk/esp32s2/lib/liblwip.a b/tools/sdk/esp32s2/lib/liblwip.a index eea55df37c3..708f8892cec 100644 Binary files a/tools/sdk/esp32s2/lib/liblwip.a and b/tools/sdk/esp32s2/lib/liblwip.a differ diff --git a/tools/sdk/esp32s2/lib/libmbedcrypto.a b/tools/sdk/esp32s2/lib/libmbedcrypto.a index 418adc64c9b..02273f5c634 100644 Binary files a/tools/sdk/esp32s2/lib/libmbedcrypto.a and b/tools/sdk/esp32s2/lib/libmbedcrypto.a differ diff --git a/tools/sdk/esp32s2/lib/libmbedtls.a b/tools/sdk/esp32s2/lib/libmbedtls.a index b7e604efa06..60f063af059 100644 Binary files a/tools/sdk/esp32s2/lib/libmbedtls.a and b/tools/sdk/esp32s2/lib/libmbedtls.a differ diff --git a/tools/sdk/esp32s2/lib/libmbedx509.a b/tools/sdk/esp32s2/lib/libmbedx509.a index 4272535a8cc..dc361746216 100644 Binary files a/tools/sdk/esp32s2/lib/libmbedx509.a and b/tools/sdk/esp32s2/lib/libmbedx509.a differ diff --git a/tools/sdk/esp32s2/lib/libmdns.a b/tools/sdk/esp32s2/lib/libmdns.a index 36697b3f178..089b8805f30 100644 Binary files a/tools/sdk/esp32s2/lib/libmdns.a and b/tools/sdk/esp32s2/lib/libmdns.a differ diff --git a/tools/sdk/esp32s2/lib/libmesh.a b/tools/sdk/esp32s2/lib/libmesh.a index 36b6e3f6717..607f468b4af 100644 Binary files a/tools/sdk/esp32s2/lib/libmesh.a and b/tools/sdk/esp32s2/lib/libmesh.a differ diff --git a/tools/sdk/esp32s2/lib/libmqtt.a b/tools/sdk/esp32s2/lib/libmqtt.a index ce6bc3cf1b5..227973faab6 100644 Binary files a/tools/sdk/esp32s2/lib/libmqtt.a and b/tools/sdk/esp32s2/lib/libmqtt.a differ diff --git a/tools/sdk/esp32s2/lib/libnet80211.a b/tools/sdk/esp32s2/lib/libnet80211.a index 46614493707..3d2c6b257b0 100644 Binary files a/tools/sdk/esp32s2/lib/libnet80211.a and b/tools/sdk/esp32s2/lib/libnet80211.a differ diff --git a/tools/sdk/esp32s2/lib/libnewlib.a b/tools/sdk/esp32s2/lib/libnewlib.a index a61783b5a0e..265932cb262 100644 Binary files a/tools/sdk/esp32s2/lib/libnewlib.a and b/tools/sdk/esp32s2/lib/libnewlib.a differ diff --git a/tools/sdk/esp32s2/lib/libnghttp.a b/tools/sdk/esp32s2/lib/libnghttp.a index b1f104d728f..379bd00df53 100644 Binary files a/tools/sdk/esp32s2/lib/libnghttp.a and b/tools/sdk/esp32s2/lib/libnghttp.a differ diff --git a/tools/sdk/esp32s2/lib/libnvs_flash.a b/tools/sdk/esp32s2/lib/libnvs_flash.a index 1e786bd4668..d4e0512045f 100644 Binary files a/tools/sdk/esp32s2/lib/libnvs_flash.a and b/tools/sdk/esp32s2/lib/libnvs_flash.a differ diff --git a/tools/sdk/esp32s2/lib/libopenssl.a b/tools/sdk/esp32s2/lib/libopenssl.a index d57e7964363..ce2e185fa65 100644 Binary files a/tools/sdk/esp32s2/lib/libopenssl.a and b/tools/sdk/esp32s2/lib/libopenssl.a differ diff --git a/tools/sdk/esp32s2/lib/libperfmon.a b/tools/sdk/esp32s2/lib/libperfmon.a index 1e73e5b4b8e..11955127286 100644 Binary files a/tools/sdk/esp32s2/lib/libperfmon.a and b/tools/sdk/esp32s2/lib/libperfmon.a differ diff --git a/tools/sdk/esp32s2/lib/libpp.a b/tools/sdk/esp32s2/lib/libpp.a index 0069750317d..aec44ca7fe6 100644 Binary files a/tools/sdk/esp32s2/lib/libpp.a and b/tools/sdk/esp32s2/lib/libpp.a differ diff --git a/tools/sdk/esp32s2/lib/libprotobuf-c.a b/tools/sdk/esp32s2/lib/libprotobuf-c.a index c1bbf0ace3e..9946acbf4c8 100644 Binary files a/tools/sdk/esp32s2/lib/libprotobuf-c.a and b/tools/sdk/esp32s2/lib/libprotobuf-c.a differ diff --git a/tools/sdk/esp32s2/lib/libprotocomm.a b/tools/sdk/esp32s2/lib/libprotocomm.a index 0e1e2f5e55d..4039b26a3f4 100644 Binary files a/tools/sdk/esp32s2/lib/libprotocomm.a and b/tools/sdk/esp32s2/lib/libprotocomm.a differ diff --git a/tools/sdk/esp32s2/lib/libpthread.a b/tools/sdk/esp32s2/lib/libpthread.a index 7156519d565..5ac978d4f15 100644 Binary files a/tools/sdk/esp32s2/lib/libpthread.a and b/tools/sdk/esp32s2/lib/libpthread.a differ diff --git a/tools/sdk/esp32s2/lib/libsdmmc.a b/tools/sdk/esp32s2/lib/libsdmmc.a index e6985017329..bc2c23558bd 100644 Binary files a/tools/sdk/esp32s2/lib/libsdmmc.a and b/tools/sdk/esp32s2/lib/libsdmmc.a differ diff --git a/tools/sdk/esp32s2/lib/libsmartconfig.a b/tools/sdk/esp32s2/lib/libsmartconfig.a index b843774944e..952a6b3c8f1 100644 Binary files a/tools/sdk/esp32s2/lib/libsmartconfig.a and b/tools/sdk/esp32s2/lib/libsmartconfig.a differ diff --git a/tools/sdk/esp32s2/lib/libsoc.a b/tools/sdk/esp32s2/lib/libsoc.a index bf5b0e609ee..e5f71f56668 100644 Binary files a/tools/sdk/esp32s2/lib/libsoc.a and b/tools/sdk/esp32s2/lib/libsoc.a differ diff --git a/tools/sdk/esp32s2/lib/libspi_flash.a b/tools/sdk/esp32s2/lib/libspi_flash.a index eda6787f542..49fa0396d0e 100644 Binary files a/tools/sdk/esp32s2/lib/libspi_flash.a and b/tools/sdk/esp32s2/lib/libspi_flash.a differ diff --git a/tools/sdk/esp32s2/lib/libspiffs.a b/tools/sdk/esp32s2/lib/libspiffs.a index 4710e273717..375e9cef62a 100644 Binary files a/tools/sdk/esp32s2/lib/libspiffs.a and b/tools/sdk/esp32s2/lib/libspiffs.a differ diff --git a/tools/sdk/esp32s2/lib/libtcp_transport.a b/tools/sdk/esp32s2/lib/libtcp_transport.a index bf4e85a6299..7b0e4dd99e3 100644 Binary files a/tools/sdk/esp32s2/lib/libtcp_transport.a and b/tools/sdk/esp32s2/lib/libtcp_transport.a differ diff --git a/tools/sdk/esp32s2/lib/libtcpip_adapter.a b/tools/sdk/esp32s2/lib/libtcpip_adapter.a index 12f552ced2f..9efb7f031db 100644 Binary files a/tools/sdk/esp32s2/lib/libtcpip_adapter.a and b/tools/sdk/esp32s2/lib/libtcpip_adapter.a differ diff --git a/tools/sdk/esp32s2/lib/libtouch_element.a b/tools/sdk/esp32s2/lib/libtouch_element.a index 9d6a22b4bbb..d15fed6f951 100644 Binary files a/tools/sdk/esp32s2/lib/libtouch_element.a and b/tools/sdk/esp32s2/lib/libtouch_element.a differ diff --git a/tools/sdk/esp32s2/lib/libulp.a b/tools/sdk/esp32s2/lib/libulp.a index e8fd3379e6f..5da81246264 100644 Binary files a/tools/sdk/esp32s2/lib/libulp.a and b/tools/sdk/esp32s2/lib/libulp.a differ diff --git a/tools/sdk/esp32s2/lib/libunity.a b/tools/sdk/esp32s2/lib/libunity.a index 9268b2391ff..3a597a6926d 100644 Binary files a/tools/sdk/esp32s2/lib/libunity.a and b/tools/sdk/esp32s2/lib/libunity.a differ diff --git a/tools/sdk/esp32s2/lib/libusb.a b/tools/sdk/esp32s2/lib/libusb.a index 1a505d45aa0..767910c9002 100644 Binary files a/tools/sdk/esp32s2/lib/libusb.a and b/tools/sdk/esp32s2/lib/libusb.a differ diff --git a/tools/sdk/esp32s2/lib/libvfs.a b/tools/sdk/esp32s2/lib/libvfs.a index 33a82e041a3..8c806df82d0 100644 Binary files a/tools/sdk/esp32s2/lib/libvfs.a and b/tools/sdk/esp32s2/lib/libvfs.a differ diff --git a/tools/sdk/esp32s2/lib/libwapi.a b/tools/sdk/esp32s2/lib/libwapi.a index 1cdd6cbab29..71485600253 100644 Binary files a/tools/sdk/esp32s2/lib/libwapi.a and b/tools/sdk/esp32s2/lib/libwapi.a differ diff --git a/tools/sdk/esp32s2/lib/libwear_levelling.a b/tools/sdk/esp32s2/lib/libwear_levelling.a index 58b25545917..42e72e1cd5a 100644 Binary files a/tools/sdk/esp32s2/lib/libwear_levelling.a and b/tools/sdk/esp32s2/lib/libwear_levelling.a differ diff --git a/tools/sdk/esp32s2/lib/libwifi_provisioning.a b/tools/sdk/esp32s2/lib/libwifi_provisioning.a index 94ff9d38299..9056b82679c 100644 Binary files a/tools/sdk/esp32s2/lib/libwifi_provisioning.a and b/tools/sdk/esp32s2/lib/libwifi_provisioning.a differ diff --git a/tools/sdk/esp32s2/lib/libwpa_supplicant.a b/tools/sdk/esp32s2/lib/libwpa_supplicant.a index 7f89e009ac0..5dcfa9c3a36 100644 Binary files a/tools/sdk/esp32s2/lib/libwpa_supplicant.a and b/tools/sdk/esp32s2/lib/libwpa_supplicant.a differ diff --git a/tools/sdk/esp32s2/lib/libxtensa.a b/tools/sdk/esp32s2/lib/libxtensa.a index 2f75edbb729..44114f73ccb 100644 Binary files a/tools/sdk/esp32s2/lib/libxtensa.a and b/tools/sdk/esp32s2/lib/libxtensa.a differ diff --git a/tools/sdk/esp32s2/sdkconfig b/tools/sdk/esp32s2/sdkconfig index b85ffccf9c6..1a5566f1f08 100644 --- a/tools/sdk/esp32s2/sdkconfig +++ b/tools/sdk/esp32s2/sdkconfig @@ -95,7 +95,6 @@ CONFIG_ESPTOOLPY_FLASHMODE_QIO=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_26M is not set @@ -144,20 +143,20 @@ CONFIG_PARTITION_TABLE_MD5=y # CONFIG_ENABLE_ARDUINO_DEPENDS=y CONFIG_AUTOSTART_ARDUINO=y -# CONFIG_ARDUINO_RUN_CORE0 is not set -CONFIG_ARDUINO_RUN_CORE1=y +CONFIG_ARDUINO_RUN_CORE0=y +# CONFIG_ARDUINO_RUN_CORE1 is not set # CONFIG_ARDUINO_RUN_NO_AFFINITY is not set -CONFIG_ARDUINO_RUNNING_CORE=1 +CONFIG_ARDUINO_RUNNING_CORE=0 CONFIG_ARDUINO_LOOP_STACK_SIZE=8192 -# CONFIG_ARDUINO_EVENT_RUN_CORE0 is not set -CONFIG_ARDUINO_EVENT_RUN_CORE1=y +CONFIG_ARDUINO_EVENT_RUN_CORE0=y +# CONFIG_ARDUINO_EVENT_RUN_CORE1 is not set # CONFIG_ARDUINO_EVENT_RUN_NO_AFFINITY is not set -CONFIG_ARDUINO_EVENT_RUNNING_CORE=1 -# CONFIG_ARDUINO_UDP_RUN_CORE0 is not set -CONFIG_ARDUINO_UDP_RUN_CORE1=y +CONFIG_ARDUINO_EVENT_RUNNING_CORE=0 +CONFIG_ARDUINO_UDP_RUN_CORE0=y +# CONFIG_ARDUINO_UDP_RUN_CORE1 is not set # CONFIG_ARDUINO_UDP_RUN_NO_AFFINITY is not set CONFIG_ARDUINO_UDP_TASK_PRIORITY=3 -CONFIG_ARDUINO_UDP_RUNNING_CORE=1 +CONFIG_ARDUINO_UDP_RUNNING_CORE=0 # CONFIG_ARDUINO_ISR_IRAM is not set # CONFIG_DISABLE_HAL_LOCKS is not set @@ -575,6 +574,7 @@ 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_ENABLE_USB is not set # end of PHY # @@ -671,6 +671,7 @@ CONFIG_ESP_WIFI_FTM_RESPONDER_SUPPORT=y # CONFIG_ESP_WIFI_STA_DISCONNECTED_PM_ENABLE is not set # CONFIG_ESP_WIFI_EXTERNAL_COEXIST_ENABLE is not set # CONFIG_ESP_WIFI_GMAC_SUPPORT is not set +CONFIG_ESP_WIFI_SOFTAP_SUPPORT=y # end of Wi-Fi # @@ -879,6 +880,7 @@ CONFIG_LWIP_GARP_TMR_INTERVAL=60 CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=32 # CONFIG_LWIP_DHCP_DOES_ARP_CHECK is not set # CONFIG_LWIP_DHCP_DISABLE_CLIENT_ID is not set +CONFIG_LWIP_DHCP_DISABLE_VENDOR_CLASS_ID=y CONFIG_LWIP_DHCP_RESTORE_LAST_IP=y CONFIG_LWIP_DHCP_OPTIONS_LEN=128 @@ -964,8 +966,9 @@ CONFIG_LWIP_MAX_RAW_PCBS=16 # # SNTP # -CONFIG_LWIP_SNTP_MAX_SERVERS=1 -# CONFIG_LWIP_DHCP_GET_NTP_SRV is not set +CONFIG_LWIP_SNTP_MAX_SERVERS=3 +CONFIG_LWIP_DHCP_GET_NTP_SRV=y +CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1 CONFIG_LWIP_SNTP_UPDATE_DELAY=3600000 # end of SNTP diff --git a/variants/adafruit_feather_esp32s2/bootloader.bin b/variants/adafruit_feather_esp32s2/bootloader.bin index e2797e37f9d..857327ea6d4 100644 Binary files a/variants/adafruit_feather_esp32s2/bootloader.bin and b/variants/adafruit_feather_esp32s2/bootloader.bin differ diff --git a/variants/adafruit_feather_esp32s2/pins_arduino.h b/variants/adafruit_feather_esp32s2/pins_arduino.h index 36f23d63186..88e22cd1b64 100644 --- a/variants/adafruit_feather_esp32s2/pins_arduino.h +++ b/variants/adafruit_feather_esp32s2/pins_arduino.h @@ -42,18 +42,13 @@ static const uint8_t A4 = 14; static const uint8_t A5 = 8; +static const uint8_t TX = 39; +static const uint8_t RX = 38; +#define TX1 TX +#define RX1 RX - -static const uint8_t TX = 43; -static const uint8_t RX = 44; - -static const uint8_t T1 = 1; -static const uint8_t T2 = 2; -static const uint8_t T3 = 3; -static const uint8_t T4 = 4; static const uint8_t T5 = 5; static const uint8_t T6 = 6; -static const uint8_t T7 = 7; static const uint8_t T8 = 8; static const uint8_t T9 = 9; static const uint8_t T10 = 10; diff --git a/variants/adafruit_feather_esp32s2/tinyuf2.bin b/variants/adafruit_feather_esp32s2/tinyuf2.bin index 434c8c97adc..17143a676ee 100644 Binary files a/variants/adafruit_feather_esp32s2/tinyuf2.bin and b/variants/adafruit_feather_esp32s2/tinyuf2.bin differ diff --git a/variants/adafruit_feather_esp32s2_reversetft/bootloader.bin b/variants/adafruit_feather_esp32s2_reversetft/bootloader.bin new file mode 100644 index 00000000000..9889ef9386e Binary files /dev/null and b/variants/adafruit_feather_esp32s2_reversetft/bootloader.bin differ diff --git a/variants/adafruit_feather_esp32s2_reversetft/partitions.csv b/variants/adafruit_feather_esp32s2_reversetft/partitions.csv new file mode 100644 index 00000000000..164ba0d5965 --- /dev/null +++ b/variants/adafruit_feather_esp32s2_reversetft/partitions.csv @@ -0,0 +1,11 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +# bootloader.bin,, 0x1000, 32K +# partition table, 0x8000, 4K + +nvs, data, nvs, 0x9000, 20K, +otadata, data, ota, 0xe000, 8K, +ota_0, 0, ota_0, 0x10000, 1408K, +ota_1, 0, ota_1, 0x170000, 1408K, +uf2, app, factory,0x2d0000, 256K, +ffat, data, fat, 0x310000, 960K, diff --git a/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h b/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h new file mode 100644 index 00000000000..84cfd2879cd --- /dev/null +++ b/variants/adafruit_feather_esp32s2_reversetft/pins_arduino.h @@ -0,0 +1,68 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + + +#define USB_VID 0x239A +#define USB_PID 0x80ED +#define USB_MANUFACTURER "Adafruit" +#define USB_PRODUCT "Feather ESP32-S2 Reverse TFT" +#define USB_SERIAL "" // Empty string for MAC adddress + + +#define EXTERNAL_NUM_INTERRUPTS 46 +#define NUM_DIGITAL_PINS 48 +#define NUM_ANALOG_INPUTS 20 + +#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) +#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) +#define digitalPinHasPWM(p) (p < 46) + +#define LED_BUILTIN 13 + +#define PIN_NEOPIXEL 33 +#define NEOPIXEL_NUM 1 // number of neopixels +#define NEOPIXEL_POWER 21 // power pin +#define NEOPIXEL_POWER_ON HIGH // power pin state when on + +#define TFT_I2C_POWER 7 +#define TFT_CS 42 +#define TFT_RST 41 +#define TFT_DC 40 +#define TFT_BACKLITE 45 + +static const uint8_t SDA = 3; +static const uint8_t SCL = 4; + +static const uint8_t SS = 42; +static const uint8_t MOSI = 35; +static const uint8_t SCK = 36; +static const uint8_t MISO = 37; + +static const uint8_t A0 = 18; +static const uint8_t A1 = 17; +static const uint8_t A2 = 16; +static const uint8_t A3 = 15; +static const uint8_t A4 = 14; +static const uint8_t A5 = 8; + +static const uint8_t TX = 39; +static const uint8_t RX = 38; +static const uint8_t TX1 = 39; +static const uint8_t RX1 = 38; + +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; +static const uint8_t T10 = 10; +static const uint8_t T11 = 11; +static const uint8_t T12 = 12; +static const uint8_t T13 = 13; +static const uint8_t T14 = 14; + +static const uint8_t DAC1 = 17; +static const uint8_t DAC2 = 18; + +#endif /* Pins_Arduino_h */ diff --git a/variants/adafruit_feather_esp32s2_reversetft/tinyuf2.bin b/variants/adafruit_feather_esp32s2_reversetft/tinyuf2.bin new file mode 100644 index 00000000000..459ab1022e3 Binary files /dev/null and b/variants/adafruit_feather_esp32s2_reversetft/tinyuf2.bin differ diff --git a/variants/adafruit_feather_esp32s2_tft/bootloader.bin b/variants/adafruit_feather_esp32s2_tft/bootloader.bin new file mode 100644 index 00000000000..5f49742aa44 Binary files /dev/null and b/variants/adafruit_feather_esp32s2_tft/bootloader.bin differ diff --git a/variants/adafruit_feather_esp32s2_tft/partitions.csv b/variants/adafruit_feather_esp32s2_tft/partitions.csv new file mode 100644 index 00000000000..164ba0d5965 --- /dev/null +++ b/variants/adafruit_feather_esp32s2_tft/partitions.csv @@ -0,0 +1,11 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +# bootloader.bin,, 0x1000, 32K +# partition table, 0x8000, 4K + +nvs, data, nvs, 0x9000, 20K, +otadata, data, ota, 0xe000, 8K, +ota_0, 0, ota_0, 0x10000, 1408K, +ota_1, 0, ota_1, 0x170000, 1408K, +uf2, app, factory,0x2d0000, 256K, +ffat, data, fat, 0x310000, 960K, diff --git a/variants/adafruit_feather_esp32s2_tft/pins_arduino.h b/variants/adafruit_feather_esp32s2_tft/pins_arduino.h new file mode 100644 index 00000000000..03ca198d8cd --- /dev/null +++ b/variants/adafruit_feather_esp32s2_tft/pins_arduino.h @@ -0,0 +1,68 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + + +#define USB_VID 0x239A +#define USB_PID 0x810F +#define USB_MANUFACTURER "Adafruit" +#define USB_PRODUCT "Feather ESP32-S2 TFT" +#define USB_SERIAL "" // Empty string for MAC adddress + + +#define EXTERNAL_NUM_INTERRUPTS 46 +#define NUM_DIGITAL_PINS 48 +#define NUM_ANALOG_INPUTS 20 + +#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) +#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) +#define digitalPinHasPWM(p) (p < 46) + +#define LED_BUILTIN 13 + +#define PIN_NEOPIXEL 33 +#define NEOPIXEL_NUM 1 // number of neopixels +#define NEOPIXEL_POWER 34 // power pin +#define NEOPIXEL_POWER_ON HIGH // power pin state when on + +#define TFT_I2C_POWER 21 +#define TFT_CS 7 +#define TFT_RST 40 +#define TFT_DC 39 +#define TFT_BACKLITE 45 + +static const uint8_t SDA = 42; +static const uint8_t SCL = 41; + +static const uint8_t SS = 7; +static const uint8_t MOSI = 35; +static const uint8_t SCK = 36; +static const uint8_t MISO = 37; + +static const uint8_t A0 = 18; +static const uint8_t A1 = 17; +static const uint8_t A2 = 16; +static const uint8_t A3 = 15; +static const uint8_t A4 = 14; +static const uint8_t A5 = 8; + +static const uint8_t TX = 1; +static const uint8_t RX = 2; + +static const uint8_t T1 = 1; +static const uint8_t T2 = 2; +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; +static const uint8_t T10 = 10; +static const uint8_t T11 = 11; +static const uint8_t T12 = 12; +static const uint8_t T13 = 13; +static const uint8_t T14 = 14; + +static const uint8_t DAC1 = 17; +static const uint8_t DAC2 = 18; + +#endif /* Pins_Arduino_h */ diff --git a/variants/adafruit_feather_esp32s2_tft/tinyuf2.bin b/variants/adafruit_feather_esp32s2_tft/tinyuf2.bin new file mode 100644 index 00000000000..740599eca54 Binary files /dev/null and b/variants/adafruit_feather_esp32s2_tft/tinyuf2.bin differ diff --git a/variants/adafruit_funhouse_esp32s2/bootloader.bin b/variants/adafruit_funhouse_esp32s2/bootloader.bin index a8d573b0491..b2eb0caa2b1 100644 Binary files a/variants/adafruit_funhouse_esp32s2/bootloader.bin and b/variants/adafruit_funhouse_esp32s2/bootloader.bin differ diff --git a/variants/adafruit_funhouse_esp32s2/pins_arduino.h b/variants/adafruit_funhouse_esp32s2/pins_arduino.h index 3b8d19e329b..a9076903fb5 100644 --- a/variants/adafruit_funhouse_esp32s2/pins_arduino.h +++ b/variants/adafruit_funhouse_esp32s2/pins_arduino.h @@ -61,11 +61,6 @@ static const uint8_t A3 = 18; // light sensor static const uint8_t TX = 43; static const uint8_t RX = 44; -static const uint8_t T1 = 1; -static const uint8_t T2 = 2; -static const uint8_t T3 = 3; -static const uint8_t T4 = 4; -static const uint8_t T5 = 5; static const uint8_t T6 = 6; static const uint8_t T7 = 7; static const uint8_t T8 = 8; @@ -74,7 +69,6 @@ static const uint8_t T10 = 10; static const uint8_t T11 = 11; static const uint8_t T12 = 12; static const uint8_t T13 = 13; -static const uint8_t T14 = 14; static const uint8_t DAC1 = 17; static const uint8_t DAC2 = 18; diff --git a/variants/adafruit_funhouse_esp32s2/tinyuf2.bin b/variants/adafruit_funhouse_esp32s2/tinyuf2.bin index 9b344159d75..6fa2ea6eee5 100644 Binary files a/variants/adafruit_funhouse_esp32s2/tinyuf2.bin and b/variants/adafruit_funhouse_esp32s2/tinyuf2.bin differ diff --git a/variants/adafruit_magtag29_esp32s2/bootloader.bin b/variants/adafruit_magtag29_esp32s2/bootloader.bin index 2ba2cd8c433..264bc74a3be 100644 Binary files a/variants/adafruit_magtag29_esp32s2/bootloader.bin and b/variants/adafruit_magtag29_esp32s2/bootloader.bin differ diff --git a/variants/adafruit_magtag29_esp32s2/pins_arduino.h b/variants/adafruit_magtag29_esp32s2/pins_arduino.h index 55aafd1a657..8142ab5ca6b 100644 --- a/variants/adafruit_magtag29_esp32s2/pins_arduino.h +++ b/variants/adafruit_magtag29_esp32s2/pins_arduino.h @@ -87,20 +87,8 @@ static const uint8_t A18 = 19; static const uint8_t A19 = 20; -static const uint8_t T1 = 1; -static const uint8_t T2 = 2; -static const uint8_t T3 = 3; -static const uint8_t T4 = 4; -static const uint8_t T5 = 5; -static const uint8_t T6 = 6; -static const uint8_t T7 = 7; -static const uint8_t T8 = 8; -static const uint8_t T9 = 9; static const uint8_t T10 = 10; -static const uint8_t T11 = 11; -static const uint8_t T12 = 12; -static const uint8_t T13 = 13; -static const uint8_t T14 = 14; + static const uint8_t DAC1 = 17; static const uint8_t DAC2 = 18; diff --git a/variants/adafruit_magtag29_esp32s2/tinyuf2.bin b/variants/adafruit_magtag29_esp32s2/tinyuf2.bin index 8f78bc9d0cb..8051c93cb47 100644 Binary files a/variants/adafruit_magtag29_esp32s2/tinyuf2.bin and b/variants/adafruit_magtag29_esp32s2/tinyuf2.bin differ diff --git a/variants/adafruit_metro_esp32s2/bootloader.bin b/variants/adafruit_metro_esp32s2/bootloader.bin index 87938c4771a..ae9d2706e2c 100644 Binary files a/variants/adafruit_metro_esp32s2/bootloader.bin and b/variants/adafruit_metro_esp32s2/bootloader.bin differ diff --git a/variants/adafruit_metro_esp32s2/tinyuf2.bin b/variants/adafruit_metro_esp32s2/tinyuf2.bin index 33c7995162d..6bad0459a6d 100644 Binary files a/variants/adafruit_metro_esp32s2/tinyuf2.bin and b/variants/adafruit_metro_esp32s2/tinyuf2.bin differ diff --git a/variants/adafruit_qtpy_esp32s2/bootloader.bin b/variants/adafruit_qtpy_esp32s2/bootloader.bin new file mode 100644 index 00000000000..885ce46328e Binary files /dev/null and b/variants/adafruit_qtpy_esp32s2/bootloader.bin differ diff --git a/variants/adafruit_qtpy_esp32s2/partitions.csv b/variants/adafruit_qtpy_esp32s2/partitions.csv new file mode 100644 index 00000000000..164ba0d5965 --- /dev/null +++ b/variants/adafruit_qtpy_esp32s2/partitions.csv @@ -0,0 +1,11 @@ +# ESP-IDF Partition Table +# Name, Type, SubType, Offset, Size, Flags +# bootloader.bin,, 0x1000, 32K +# partition table, 0x8000, 4K + +nvs, data, nvs, 0x9000, 20K, +otadata, data, ota, 0xe000, 8K, +ota_0, 0, ota_0, 0x10000, 1408K, +ota_1, 0, ota_1, 0x170000, 1408K, +uf2, app, factory,0x2d0000, 256K, +ffat, data, fat, 0x310000, 960K, diff --git a/variants/adafruit_qtpy_esp32s2/pins_arduino.h b/variants/adafruit_qtpy_esp32s2/pins_arduino.h new file mode 100644 index 00000000000..1373212ba4d --- /dev/null +++ b/variants/adafruit_qtpy_esp32s2/pins_arduino.h @@ -0,0 +1,63 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + + +#define USB_VID 0x239A +#define USB_PID 0x8111 +#define USB_MANUFACTURER "Adafruit" +#define USB_PRODUCT "QT Py ESP32-S2" +#define USB_SERIAL "" // Empty string for MAC adddress + + +#define EXTERNAL_NUM_INTERRUPTS 46 +#define NUM_DIGITAL_PINS 48 +#define NUM_ANALOG_INPUTS 20 + +#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) +#define digitalPinToInterrupt(p) (((p)<48)?(p):-1) +#define digitalPinHasPWM(p) (p < 46) + +//#define LED_BUILTIN 13 + +#define PIN_NEOPIXEL 39 +#define NEOPIXEL_NUM 1 // number of neopixels +#define NEOPIXEL_POWER 38 // power pin +#define NEOPIXEL_POWER_ON HIGH // power pin state when on + +static const uint8_t SDA = 7; +static const uint8_t SCL = 6; + +static const uint8_t SDA1 = 41; +static const uint8_t SCL1 = 40; + +static const uint8_t SS = 42; +static const uint8_t MOSI = 35; +static const uint8_t SCK = 36; +static const uint8_t MISO = 37; + +static const uint8_t A0 = 18; +static const uint8_t A1 = 17; +static const uint8_t A2 = 9; +static const uint8_t A3 = 8; +static const uint8_t A4 = 7; +static const uint8_t A5 = 6; +static const uint8_t A6 = 5; +static const uint8_t A7 = 16; + +static const uint8_t TX = 5; +static const uint8_t RX = 16; +#define TX1 TX +#define RX1 RX + +static const uint8_t T5 = 5; +static const uint8_t T6 = 6; +static const uint8_t T7 = 7; +static const uint8_t T8 = 8; +static const uint8_t T9 = 9; + +static const uint8_t DAC1 = 17; +static const uint8_t DAC2 = 18; + +#endif /* Pins_Arduino_h */ diff --git a/variants/adafruit_qtpy_esp32s2/tinyuf2.bin b/variants/adafruit_qtpy_esp32s2/tinyuf2.bin new file mode 100644 index 00000000000..29378f2bf25 Binary files /dev/null and b/variants/adafruit_qtpy_esp32s2/tinyuf2.bin differ diff --git a/variants/dpu_esp32/pins_arduino.h b/variants/dpu_esp32/pins_arduino.h new file mode 100644 index 00000000000..59afb94b132 --- /dev/null +++ b/variants/dpu_esp32/pins_arduino.h @@ -0,0 +1,64 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define EXTERNAL_NUM_INTERRUPTS 16 +#define NUM_DIGITAL_PINS 40 +#define NUM_ANALOG_INPUTS 16 + +#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) +#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) +#define digitalPinHasPWM(p) (p < 34) + +static const uint8_t TX = 1; +static const uint8_t RX = 3; + +static const uint8_t A0 = 36; +static const uint8_t A3 = 39; +static const uint8_t A4 = 32; +static const uint8_t A5 = 33; +static const uint8_t A6 = 34; +static const uint8_t A7 = 35; +static const uint8_t A10 = 4; +static const uint8_t A11 = 0; +static const uint8_t A12 = 2; +static const uint8_t A13 = 15; +static const uint8_t A14 = 13; +static const uint8_t A15 = 12; +static const uint8_t A16 = 14; +static const uint8_t A17 = 27; +static const uint8_t A18 = 25; +static const uint8_t A19 = 26; + +static const uint8_t T0 = 4; +static const uint8_t T1 = 0; +static const uint8_t T2 = 2; +static const uint8_t T3 = 15; +static const uint8_t T4 = 13; +static const uint8_t T5 = 12; +static const uint8_t T6 = 14; +static const uint8_t T7 = 27; +static const uint8_t T8 = 33; +static const uint8_t T9 = 32; + +static const uint8_t DAC1 = 25; +static const uint8_t DAC2 = 26; + +static const uint8_t SDA = 4; +static const uint8_t SCL = 5; + +static const uint8_t MOSI = 13; +static const uint8_t MISO = 12; +static const uint8_t SCK = 14; +static const uint8_t SS = 15; + +static const uint8_t TP_RST = 21; +static const uint8_t TP_INT = 19; +static const uint8_t TFT_BL = 18; +static const uint8_t TFT_CS = 15; +static const uint8_t TFT_DC = 27; +static const uint8_t TFT_RST = 32; +static const uint8_t SD_CS = 23; +static const uint8_t SD_CD = 22; +#endif /* Pins_Arduino_h */ diff --git a/variants/sonoff_dualr3/pins_arduino.h b/variants/sonoff_dualr3/pins_arduino.h new file mode 100644 index 00000000000..eec170ae21e --- /dev/null +++ b/variants/sonoff_dualr3/pins_arduino.h @@ -0,0 +1,27 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +#include + +#define EXTERNAL_NUM_INTERRUPTS 16 +#define NUM_DIGITAL_PINS 40 +#define NUM_ANALOG_INPUTS 16 + +#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) +#define digitalPinToInterrupt(p) (((p)<40)?(p):-1) +#define digitalPinHasPWM(p) (p < 34) + +static const uint8_t TX = 1; +static const uint8_t RX = 3; + +static const uint8_t BUTTON = 0; +static const uint8_t LED_LINK = 13; +static const uint8_t RELAY_2 = 14; +static const uint8_t RELAY_1 = 27; +static const uint8_t SWITCH_2 = 33; +static const uint8_t SWITCH_1 = 32; + +static const uint8_t CSE7761_TX = 25; +static const uint8_t CSE7761_RX = 26; + +#endif /* Pins_Arduino_h */ diff --git a/variants/ttgo-lora32-v21new/pins_arduino.h b/variants/ttgo-lora32-v21new/pins_arduino.h index 931ff29839a..c8870a7cd06 100644 --- a/variants/ttgo-lora32-v21new/pins_arduino.h +++ b/variants/ttgo-lora32-v21new/pins_arduino.h @@ -27,7 +27,7 @@ #define LORA_MISO 19 // GPIO19 - SX1276 MISO #define LORA_MOSI 27 // GPIO27 - SX1276 MOSI #define LORA_CS 18 // GPIO18 - SX1276 CS -#define LORA_RST 12 // GPIO14 - SX1276 RST +#define LORA_RST 23 // GPIO23 - SX1276 RST #define LORA_IRQ 26 // GPIO26 - SX1276 IRQ (interrupt request) #define LORA_D1 33 // GPIO33 - SX1276 IO1 (for LMIC Arduino library) #define LORA_D2 32 // GPIO32 - SX1276 IO2 @@ -63,7 +63,7 @@ static const uint8_t A4 = 32; static const uint8_t A5 = 33; static const uint8_t A6 = 34; static const uint8_t A7 = 35; -static const uint8_t A10 = 4; +static const uint8_t A10 = 4; static const uint8_t A11 = 0; static const uint8_t A12 = 2; static const uint8_t A13 = 15; diff --git a/variants/wt32-eth01/pins_arduino.h b/variants/wt32-eth01/pins_arduino.h new file mode 100644 index 00000000000..7ea22ab69c3 --- /dev/null +++ b/variants/wt32-eth01/pins_arduino.h @@ -0,0 +1,55 @@ +#ifndef Pins_Arduino_h +#define Pins_Arduino_h + +/** + * Variant: WT32-ETH01 + * Vendor: Wireless-Tag + * Url: http://www.wireless-tag.com/portfolio/wt32-eth01/ + */ + +#include + +#define EXTERNAL_NUM_INTERRUPTS 16 +#define NUM_DIGITAL_PINS 40 +#define NUM_ANALOG_INPUTS 16 + +#define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1) +#define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) +#define digitalPinHasPWM(p) (p < 34) + +// interface to Ethernet PHY (LAN8720A) +#define ETH_PHY_ADDR 1 +#define ETH_PHY_POWER 16 +#define ETH_PHY_MDC 23 +#define ETH_PHY_MDIO 18 +#define ETH_PHY_TYPE ETH_PHY_LAN8720 +#define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN + +// general purpose IO pins +static const uint8_t IO0 = 0; +static const uint8_t IO1 = 1; // TXD0 / TX0 pin +static const uint8_t IO2 = 2; +static const uint8_t IO3 = 3; // RXD0 / RX0 pin +static const uint8_t IO4 = 4; +static const uint8_t IO5 = 5; // RXD2 / RXD pin +static const uint8_t IO12 = 12; +static const uint8_t IO14 = 14; +static const uint8_t IO15 = 15; +static const uint8_t IO17 = 17; // TXD2 / TXD pin +static const uint8_t IO32 = 32; // CFG pin +static const uint8_t IO33 = 33; // 485_EN pin + +// input-only pins +static const uint8_t IO35 = 35; +static const uint8_t IO36 = 36; +static const uint8_t IO39 = 39; + +// UART interfaces +static const uint8_t TXD0 = 1, TX0 = 1; +static const uint8_t RXD0 = 3, RX0 = 3; +static const uint8_t TXD2 = 17, TXD = 17; +static const uint8_t RXD2 = 5, RXD = 5; +static const uint8_t TX = 1; +static const uint8_t RX = 3; + +#endif /* Pins_Arduino_h */